summaryrefslogtreecommitdiff
path: root/test/sys/test_socket.rs
diff options
context:
space:
mode:
authorGeoffrey Thomas <geofft@ldpreload.com>2015-10-07 23:11:30 -0400
committerCarl Lerche <me@carllerche.com>2015-10-28 09:34:43 -0700
commitad87c3bdc99357f66af9260bce1eb6ae2cbfda98 (patch)
tree7cb4a8a57398ee4361261c711995a6484328848b /test/sys/test_socket.rs
parent0cfa2a10a23712d44b4c745f4664fa3b46b9e943 (diff)
downloadnix-ad87c3bdc99357f66af9260bce1eb6ae2cbfda98.zip
Fix handling of sockaddr_un lengths
The returned length of AF_UNIX sockaddrs is significant, and generally does not match the length of the entire structure. For filesystem sockets, this is ignorable because the path is also NUL-terminated, but for unbound sockets (e.g., a socketpair) or abstract-namespace sockets (a Linux extension where the address is an arbitrary bytestring), we need to keep track of the length. Fixes #177. Also add a UnixAddr::new_abstract function and some better handling of abstract-namespace socket addresses to fix #169.
Diffstat (limited to 'test/sys/test_socket.rs')
-rw-r--r--test/sys/test_socket.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/sys/test_socket.rs b/test/sys/test_socket.rs
index 7b95767e..945638cc 100644
--- a/test/sys/test_socket.rs
+++ b/test/sys/test_socket.rs
@@ -35,7 +35,7 @@ pub fn test_path_to_sock_addr() {
let expect: &'static [i8] = unsafe { mem::transmute(&b"/foo/bar"[..]) };
assert_eq!(&addr.0.sun_path[..8], expect);
- assert_eq!(addr.path(), actual);
+ assert_eq!(addr.path(), Some(actual));
}
#[test]