Skip to content

Commit d992f78

Browse files
committed
Document address length calculation
1 parent 2c66ff6 commit d992f78

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/sys/unix/uds/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ fn unix_addr(address: &SocketAddr) -> (libc::sockaddr_un, libc::socklen_t) {
6767
};
6868

6969
let mut addrlen = path_offset(&sockaddr) + addr.len();
70+
// +1 for null byte at the end of the path, not needed for abstract
71+
// namespaces (which start with a null byte).
7072
match addr.first() {
7173
Some(&0) | None => {}
7274
Some(_) => addrlen += 1,

0 commit comments

Comments
 (0)