aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/exec_libc2.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/syscall/exec_libc2.go')
-rw-r--r--src/syscall/exec_libc2.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/syscall/exec_libc2.go b/src/syscall/exec_libc2.go
index 9eb61a5d35..41bc79a721 100644
--- a/src/syscall/exec_libc2.go
+++ b/src/syscall/exec_libc2.go
@@ -198,7 +198,7 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
nextfd++
}
for i = 0; i < len(fd); i++ {
- if fd[i] >= 0 && fd[i] < int(i) {
+ if fd[i] >= 0 && fd[i] < i {
if nextfd == pipe { // don't stomp on pipe
nextfd++
}
@@ -225,7 +225,7 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
rawSyscall(abi.FuncPCABI0(libc_close_trampoline), uintptr(i), 0, 0)
continue
}
- if fd[i] == int(i) {
+ if fd[i] == i {
// dup2(i, i) won't clear close-on-exec flag on Linux,
// probably not elsewhere either.
_, _, err1 = rawSyscall(abi.FuncPCABI0(libc_fcntl_trampoline), uintptr(fd[i]), F_SETFD, 0)