aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/syscall/exec_linux.go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-03-02 16:38:43 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-03-02 16:38:43 +0000
commitcbb6491d76c7aa81cdf5d3b3a81386129c5e2fce (patch)
treeefa0c55763b34cbc633bc494c2743d1b5d9aaff3 /libgo/go/syscall/exec_linux.go
parentff2f581b00ac6759f6366c16ef902c935163aa13 (diff)
downloadgcc-cbb6491d76c7aa81cdf5d3b3a81386129c5e2fce.zip
gcc-cbb6491d76c7aa81cdf5d3b3a81386129c5e2fce.tar.gz
gcc-cbb6491d76c7aa81cdf5d3b3a81386129c5e2fce.tar.bz2
libgo: Update to weekly.2012-02-14 release.
From-SVN: r184798
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 cc3cfdb..a6c4427 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
}