summaryrefslogtreecommitdiff
path: root/libgo/go/syscall/exec_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/syscall/exec_linux.go')
-rw-r--r--libgo/go/syscall/exec_linux.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/libgo/go/syscall/exec_linux.go b/libgo/go/syscall/exec_linux.go
index cc3cfdb0805..a6c4427a59f 100644
--- a/libgo/go/syscall/exec_linux.go
+++ b/libgo/go/syscall/exec_linux.go
@@ -21,7 +21,7 @@ type SysProcAttr struct {
Setpgid bool // Set process group ID to new pid (SYSV setpgrp)
Setctty bool // Set controlling terminal to fd 0
Noctty bool // Detach fd 0 from controlling terminal
- Pdeathsig int // Signal that the process will get when its parent dies (Linux only)
+ Pdeathsig Signal // Signal that the process will get when its parent dies (Linux only)
}
// Fork, dup fd onto 0..len(fd), and exec(argv0, argvv, envv) in child.
@@ -43,7 +43,10 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
)
// guard against side effects of shuffling fds below.
- fd := append([]int(nil), attr.Files...)
+ fd := make([]int, len(attr.Files))
+ for i, ufd := range attr.Files {
+ fd[i] = int(ufd)
+ }
// About to call fork.
// No more allocation or calls of non-assembly functions.
@@ -61,7 +64,7 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
// Parent death signal
if sys.Pdeathsig != 0 {
- _, err1 = raw_prctl(PR_SET_PDEATHSIG, sys.Pdeathsig, 0, 0, 0)
+ _, err1 = raw_prctl(PR_SET_PDEATHSIG, int(sys.Pdeathsig), 0, 0, 0)
if err1 != 0 {
goto childerror
}