aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/syscall/exec_linux.go
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2014-01-22 10:35:41 -0800
committerBrad Fitzpatrick <bradfitz@golang.org>2014-01-22 10:35:41 -0800
commitba8c92c1660bf86dfeedfc41ac39683c7e0d7607 (patch)
treea335b567f79b5be3193b42f070789d7b51cbb9a4 /src/pkg/syscall/exec_linux.go
parentb7b93a7154ea1b569019e9d993f21a52d8aeda14 (diff)
downloadgo-ba8c92c1660bf86dfeedfc41ac39683c7e0d7607.tar.xz
syscall: use unsafe.Pointer in BSD kevent
Doesn't really matter for the most part, since the runtime-integrated network poller uses its own kevent implementation, but for people using the syscall directly, we should use an unsafe.Pointer for the precise GC to retain the pointer arguments. Also push down unsafe.Pointer a bit further in exec_linux.go, not that there are any GC preemption points in the middle and sys is still live anyway. R=golang-codereviews, dvyukov CC=golang-codereviews, iant https://golang.org/cl/55520043
Diffstat (limited to 'src/pkg/syscall/exec_linux.go')
-rw-r--r--src/pkg/syscall/exec_linux.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pkg/syscall/exec_linux.go b/src/pkg/syscall/exec_linux.go
index a1656e8dce..f27950f730 100644
--- a/src/pkg/syscall/exec_linux.go
+++ b/src/pkg/syscall/exec_linux.go
@@ -131,11 +131,11 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
// User and groups
if cred := sys.Credential; cred != nil {
ngroups := uintptr(len(cred.Groups))
- groups := uintptr(0)
+ var groups unsafe.Pointer
if ngroups > 0 {
- groups = uintptr(unsafe.Pointer(&cred.Groups[0]))
+ groups = unsafe.Pointer(&cred.Groups[0])
}
- _, _, err1 = RawSyscall(SYS_SETGROUPS, ngroups, groups, 0)
+ _, _, err1 = RawSyscall(SYS_SETGROUPS, ngroups, uintptr(groups), 0)
if err1 != 0 {
goto childerror
}