]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: fix FD passing on FreeBSD and NetBSD
authorDave Cheney <dave@cheney.net>
Tue, 26 Feb 2013 22:13:15 +0000 (09:13 +1100)
committerDave Cheney <dave@cheney.net>
Tue, 26 Feb 2013 22:13:15 +0000 (09:13 +1100)
Fixes #3348.

R=devon.odell, minux.ma, bradfitz, mdempsky
CC=golang-dev
https://golang.org/cl/7406050

src/pkg/syscall/passfd_test.go
src/pkg/syscall/sockcmsg_unix.go

index 20ef39ecaab3ae6c56f410bb9fe6f36a00ff78a0..71a4a495f0cd4dc73961b440a0cc37fe88f52a8a 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build linux darwin
+// +build linux darwin freebsd netbsd
 
 package syscall_test
 
index 7d9a6ee81501435adc073f3c0cba7fce1b81a976..3af3068fd93c471f79daf91869db42bc499c8c33 100644 (file)
@@ -37,7 +37,7 @@ func CmsgSpace(datalen int) int {
 }
 
 func cmsgData(h *Cmsghdr) unsafe.Pointer {
-       return unsafe.Pointer(uintptr(unsafe.Pointer(h)) + SizeofCmsghdr)
+       return unsafe.Pointer(uintptr(unsafe.Pointer(h)) + uintptr(cmsgAlignOf(SizeofCmsghdr)))
 }
 
 // SocketControlMessage represents a socket control message.