summaryrefslogtreecommitdiffstats
path: root/vendor/curl/tests/atexit.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/curl/tests/atexit.rs')
-rw-r--r--vendor/curl/tests/atexit.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/vendor/curl/tests/atexit.rs b/vendor/curl/tests/atexit.rs
new file mode 100644
index 000000000..0872a4e97
--- /dev/null
+++ b/vendor/curl/tests/atexit.rs
@@ -0,0 +1,17 @@
+use curl::easy::Easy;
+
+pub extern "C" fn hook() {
+ let mut easy = Easy::new();
+ easy.url("google.com").unwrap();
+ easy.write_function(|data| Ok(data.len())).unwrap();
+ easy.perform().unwrap();
+}
+
+fn main() {
+ curl::init();
+ hook();
+ unsafe {
+ libc::atexit(hook);
+ }
+ println!("Finishing...")
+}