diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-08-03 16:54:30 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-08-03 16:54:30 +0200 |
commit | 28592ee1ea1f5cdffcf85472f9de0285d928cf12 (patch) | |
tree | 32944e18b23f7fe4a0818a694aa2a6dfb1835463 /src/pkg/os/exec_posix.go | |
parent | e836bee4716dc0d4d913537ad3ad1925a7ac32d0 (diff) | |
download | golang-upstream/59.tar.gz |
Imported Upstream version 59upstream/59
Diffstat (limited to 'src/pkg/os/exec_posix.go')
-rw-r--r-- | src/pkg/os/exec_posix.go | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/pkg/os/exec_posix.go b/src/pkg/os/exec_posix.go index bf992ef42..e2097700e 100644 --- a/src/pkg/os/exec_posix.go +++ b/src/pkg/os/exec_posix.go @@ -30,20 +30,14 @@ func StartProcess(name string, argv []string, attr *ProcAttr) (p *Process, err E sysattr := &syscall.ProcAttr{ Dir: attr.Dir, Env: attr.Env, + Sys: attr.Sys, } if sysattr.Env == nil { sysattr.Env = Environ() } - // Create array of integer (system) fds. - intfd := make([]int, len(attr.Files)) - for i, f := range attr.Files { - if f == nil { - intfd[i] = -1 - } else { - intfd[i] = f.Fd() - } + for _, f := range attr.Files { + sysattr.Files = append(sysattr.Files, f.Fd()) } - sysattr.Files = intfd pid, h, e := syscall.StartProcess(name, argv, sysattr) if iserror(e) { @@ -127,7 +121,10 @@ func itod(i int) string { return string(b[bp:]) } -func (w Waitmsg) String() string { +func (w *Waitmsg) String() string { + if w == nil { + return "<nil>" + } // TODO(austin) Use signal names when possible? res := "" switch { |