about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-04-23 02:11:32 -0700
committerbors <bors@rust-lang.org>2014-04-23 02:11:32 -0700
commit49b216539f52ae225dcf5280d52f1b5ee9e84474 (patch)
treec803bb144ab3dd4bc3634e56bc6fb749178941cf /src/libstd
parent34ff34d11a3ce16dcfa9eb90edac4abef9dc3647 (diff)
parentf1fb57a5cc979f5ca9c0b8ac025fb83d0aa9a7b0 (diff)
downloadrust-49b216539f52ae225dcf5280d52f1b5ee9e84474.tar.gz
rust-49b216539f52ae225dcf5280d52f1b5ee9e84474.zip
auto merge of #13690 : alexcrichton/rust/unlink-unix-pipe, r=brson
This prevents unix sockets from remaining on the system all over the place, and
more closely mirrors the behavior of libuv and windows pipes.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/io/net/unix.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libstd/io/net/unix.rs b/src/libstd/io/net/unix.rs
index 6f48abb31c7..bf568177020 100644
--- a/src/libstd/io/net/unix.rs
+++ b/src/libstd/io/net/unix.rs
@@ -355,4 +355,20 @@ mod tests {
 
         rx.recv();
     })
+
+    iotest!(fn drop_removes_listener_path() {
+        let path = next_test_unix();
+        let l = UnixListener::bind(&path).unwrap();
+        assert!(path.exists());
+        drop(l);
+        assert!(!path.exists());
+    } #[cfg(not(windows))])
+
+    iotest!(fn drop_removes_acceptor_path() {
+        let path = next_test_unix();
+        let l = UnixListener::bind(&path).unwrap();
+        assert!(path.exists());
+        drop(l.listen().unwrap());
+        assert!(!path.exists());
+    } #[cfg(not(windows))])
 }