]> Cypherpunks repositories - gostls13.git/commit
syscall: handle varied path lengths for unix sockets
authorJoel Sing <jsing@google.com>
Fri, 3 Jan 2014 13:29:20 +0000 (00:29 +1100)
committerJoel Sing <jsing@google.com>
Fri, 3 Jan 2014 13:29:20 +0000 (00:29 +1100)
commitd18057917003970322335bd1ad73a68ae6994ccd
treef7c1713d134cbc3e7fca52f7073865f904cf5eb0
parent8778760a7edb8bb1b756b6d3dbf20edb1308159e
syscall: handle varied path lengths for unix sockets

Most BSDs include the trailing NUL character of the socket path in the
length, however some do not (such as NetBSD 6.99). Handle this by only
subtracting the family and length bytes from the returned length, then
scanning the path and removing any terminating NUL bytes.

Fixes #6627.

R=golang-codereviews, mikioh.mikioh
CC=golang-codereviews
https://golang.org/cl/46420044
src/pkg/syscall/syscall_bsd.go