summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2019-12-14 13:40:00 +0100
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2019-12-14 13:40:00 +0100
commitc873528a55e08ab0a44f6f28fbfb62bbcecd9810 (patch)
tree34bdffef7a01192ade1171942d4b3b2c886dc4ac /src
parentAdded profiler feature (diff)
downloadwireguard-rs-c873528a55e08ab0a44f6f28fbfb62bbcecd9810.tar.xz
wireguard-rs-c873528a55e08ab0a44f6f28fbfb62bbcecd9810.zip
Removed unused atexit
Diffstat (limited to 'src')
-rw-r--r--src/main.rs12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/main.rs b/src/main.rs
index 57822f7..087b54b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -8,9 +8,6 @@ extern crate cpuprofiler;
#[cfg(feature = "profiler")]
use cpuprofiler::PROFILER;
-#[cfg(feature = "profiler")]
-use libc::atexit;
-
mod configuration;
mod platform;
mod wireguard;
@@ -29,13 +26,9 @@ use platform::tun::{PlatformTun, Status};
use platform::uapi::{BindUAPI, PlatformUAPI};
use platform::*;
-// destructor which stops the profiler upon program exit.
-#[cfg(feature = "profiler")]
-pub extern "C" fn dtor_profiler_stop() {
-}
-
#[cfg(feature = "profiler")]
fn profiler_stop() {
+ println!("Stopping profiler");
PROFILER.lock().unwrap().stop().unwrap();
}
@@ -53,9 +46,6 @@ fn profiler_start(name: &str) {
if !Path::new(path.as_str()).exists() {
println!("Starting profiler: {}", path);
PROFILER.lock().unwrap().start(path).unwrap();
- unsafe {
- assert_eq!(atexit(dtor_profiler_stop), 0);
- }
break;
};
n += 1;