diff options
Diffstat (limited to 'libgo/go/os/exec_posix.go')
-rw-r--r-- | libgo/go/os/exec_posix.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libgo/go/os/exec_posix.go b/libgo/go/os/exec_posix.go index 70351cfb313..40fd0fd0ee6 100644 --- a/libgo/go/os/exec_posix.go +++ b/libgo/go/os/exec_posix.go @@ -11,9 +11,10 @@ import ( ) func startProcess(name string, argv []string, attr *ProcAttr) (p *Process, err error) { - // Double-check existence of the directory we want + // If there is no SysProcAttr (ie. no Chroot or changed + // UID/GID), double-check existence of the directory we want // to chdir into. We can make the error clearer this way. - if attr != nil && attr.Dir != "" { + if attr != nil && attr.Sys == nil && attr.Dir != "" { if _, err := Stat(attr.Dir); err != nil { pe := err.(*PathError) pe.Op = "chdir" |