summaryrefslogtreecommitdiff
path: root/libgo/go/syscall/exec_unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/syscall/exec_unix.go')
-rw-r--r--libgo/go/syscall/exec_unix.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/libgo/go/syscall/exec_unix.go b/libgo/go/syscall/exec_unix.go
index 0cfedb71cf..a49d95bc94 100644
--- a/libgo/go/syscall/exec_unix.go
+++ b/libgo/go/syscall/exec_unix.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build darwin dragonfly freebsd linux netbsd openbsd
+// +build darwin dragonfly freebsd linux netbsd openbsd solaris
// Fork, exec, wait, etc.
@@ -194,7 +194,7 @@ func forkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err error)
return 0, err
}
- if runtime.GOOS == "freebsd" && len(argv[0]) > len(argv0) {
+ if (runtime.GOOS == "freebsd" || runtime.GOOS == "dragonfly") && len(argv[0]) > len(argv0) {
argvp[0] = argv0p
}
@@ -226,6 +226,7 @@ func forkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err error)
// Kick off child.
pid, err1 = forkAndExecInChild(argv0p, argvp, envvp, chroot, dir, attr, sys, p[1])
if err1 != 0 {
+ err = Errno(err1)
goto error
}
ForkLock.Unlock()