diff options
Diffstat (limited to 'src/syscall/exec_bsd.go')
| -rw-r--r-- | src/syscall/exec_bsd.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/syscall/exec_bsd.go b/src/syscall/exec_bsd.go index 0b0cd24e69..149cc2f11c 100644 --- a/src/syscall/exec_bsd.go +++ b/src/syscall/exec_bsd.go @@ -64,7 +64,7 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr ngroups, groups uintptr ) - rlim, rlimOK := origRlimitNofile.Load().(Rlimit) + rlim := origRlimitNofile.Load() // guard against side effects of shuffling fds below. // Make sure that nextfd is beyond any currently open files so @@ -276,8 +276,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. |
