From 98d44d140d7abde9fdfbdbf7adec5be7bb0892ce Mon Sep 17 00:00:00 2001 From: Dave Cheney Date: Wed, 27 Feb 2013 09:13:15 +1100 Subject: [PATCH] syscall: fix FD passing on FreeBSD and NetBSD Fixes #3348. R=devon.odell, minux.ma, bradfitz, mdempsky CC=golang-dev https://golang.org/cl/7406050 --- src/pkg/syscall/passfd_test.go | 2 +- src/pkg/syscall/sockcmsg_unix.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pkg/syscall/passfd_test.go b/src/pkg/syscall/passfd_test.go index 20ef39ecaab..71a4a495f0c 100644 --- a/src/pkg/syscall/passfd_test.go +++ b/src/pkg/syscall/passfd_test.go @@ -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 diff --git a/src/pkg/syscall/sockcmsg_unix.go b/src/pkg/syscall/sockcmsg_unix.go index 7d9a6ee8150..3af3068fd93 100644 --- a/src/pkg/syscall/sockcmsg_unix.go +++ b/src/pkg/syscall/sockcmsg_unix.go @@ -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.