aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/exec/exec.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-02-18 18:32:33 -0800
committerRuss Cox <rsc@golang.org>2010-02-18 18:32:33 -0800
commitc2dea2196c336ba195ee713fd0020031d473500e (patch)
tree02cd76934724a16f9db94e8691bace5eb4040095 /src/pkg/exec/exec.go
parent4589c3458033d8797c34dedc5f72f534487d2cd6 (diff)
downloadgo-c2dea2196c336ba195ee713fd0020031d473500e.tar.xz
exec: add dir argument to Run.
fix, test MergeWithStdout R=r CC=golang-dev https://golang.org/cl/214046
Diffstat (limited to 'src/pkg/exec/exec.go')
-rw-r--r--src/pkg/exec/exec.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pkg/exec/exec.go b/src/pkg/exec/exec.go
index 8e959e03a3..a1b7bd6b9c 100644
--- a/src/pkg/exec/exec.go
+++ b/src/pkg/exec/exec.go
@@ -78,7 +78,7 @@ func modeToFiles(mode, fd int) (*os.File, *os.File, os.Error) {
// If a parameter is Pipe, then the corresponding field (Stdin, Stdout, Stderr)
// of the returned Cmd is the other end of the pipe.
// Otherwise the field in Cmd is nil.
-func Run(argv0 string, argv, envv []string, stdin, stdout, stderr int) (p *Cmd, err os.Error) {
+func Run(argv0 string, argv, envv []string, dir string, stdin, stdout, stderr int) (p *Cmd, err os.Error) {
p = new(Cmd)
var fd [3]*os.File
@@ -89,13 +89,13 @@ func Run(argv0 string, argv, envv []string, stdin, stdout, stderr int) (p *Cmd,
goto Error
}
if stderr == MergeWithStdout {
- p.Stderr = p.Stdout
+ fd[2] = fd[1]
} else if fd[2], p.Stderr, err = modeToFiles(stderr, 2); err != nil {
goto Error
}
// Run command.
- p.Pid, err = os.ForkExec(argv0, argv, envv, "", &fd)
+ p.Pid, err = os.ForkExec(argv0, argv, envv, dir, &fd)
if err != nil {
goto Error
}