aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/exec_freebsd.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/syscall/exec_freebsd.go')
-rw-r--r--src/syscall/exec_freebsd.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/syscall/exec_freebsd.go b/src/syscall/exec_freebsd.go
index bd198d09b4..3226cb88cd 100644
--- a/src/syscall/exec_freebsd.go
+++ b/src/syscall/exec_freebsd.go
@@ -71,7 +71,7 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
upid uintptr
)
- rlim, rlimOK := origRlimitNofile.Load().(Rlimit)
+ rlim := origRlimitNofile.Load()
// Record parent PID so child can test if it has died.
ppid, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)
@@ -300,8 +300,8 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
}
// Restore original rlimit.
- if rlimOK && rlim.Cur != 0 {
- RawSyscall(SYS_SETRLIMIT, uintptr(RLIMIT_NOFILE), uintptr(unsafe.Pointer(&rlim)), 0)
+ if rlim != nil {
+ RawSyscall(SYS_SETRLIMIT, uintptr(RLIMIT_NOFILE), uintptr(unsafe.Pointer(rlim)), 0)
}
// Time to exec.