]> Cypherpunks repositories - gostls13.git/commit
syscall: handle getsockname for unix sockets on openbsd 5.2
authorJoel Sing <jsing@google.com>
Tue, 5 Mar 2013 10:40:37 +0000 (21:40 +1100)
committerJoel Sing <jsing@google.com>
Tue, 5 Mar 2013 10:40:37 +0000 (21:40 +1100)
commit1b36bcc3b59a3e123c5b1ac2617cadcb69d0e94a
treecc6327ddde56b8867de14708e05b127121edb43e
parentadd334986778a09dce559f4d8b7ee69534abd47d
syscall: handle getsockname for unix sockets on openbsd 5.2

On OpenBSD 5.2, calling getsockname on an unbound Unix domain socket
results in a successful syscall, however the AF is unset and the length
is returned as zero. This has been changed to more portable behaviour,
which will be included in the OpenBSD 5.3 release.

For now, work around this by treating a successful getsockname() call
that returns a family of AF_UNSPEC and length of zero as a AF_UNIX
socket.

Makes TestPassFD work on OpenBSD 5.2.

Fixes #4956.

R=golang-dev, minux.ma, rsc, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/7449046
src/pkg/syscall/passfd_test.go
src/pkg/syscall/syscall_bsd.go