diff options
Diffstat (limited to 'src/sys/socket')
-rw-r--r-- | src/sys/socket/addr.rs | 4 | ||||
-rw-r--r-- | src/sys/socket/consts.rs | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/sys/socket/addr.rs b/src/sys/socket/addr.rs index 22970d8b..e3c1401c 100644 --- a/src/sys/socket/addr.rs +++ b/src/sys/socket/addr.rs @@ -391,7 +391,7 @@ impl UnixAddr { .. mem::zeroed() }; - if path.len() > ret.sun_path.len() { + if path.len() + 1 > ret.sun_path.len() { return Err(Error::Sys(Errno::ENAMETOOLONG)); } @@ -401,7 +401,7 @@ impl UnixAddr { ret.sun_path.as_mut_ptr().offset(1) as *mut u8, path.len()); - Ok(UnixAddr(ret, path.len())) + Ok(UnixAddr(ret, path.len() + 1)) } } diff --git a/src/sys/socket/consts.rs b/src/sys/socket/consts.rs index aeeea5c3..63eaf28a 100644 --- a/src/sys/socket/consts.rs +++ b/src/sys/socket/consts.rs @@ -98,6 +98,7 @@ mod os { const MSG_DONTWAIT = 0x0040, const MSG_EOR = 0x0080, const MSG_ERRQUEUE = 0x2000, + const MSG_CMSG_CLOEXEC = 0x40000000, } } |