diff options
Diffstat (limited to 'libgo/go/os/exec/exec.go')
-rw-r--r-- | libgo/go/os/exec/exec.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libgo/go/os/exec/exec.go b/libgo/go/os/exec/exec.go index a70ed0d20cb..72b4905d560 100644 --- a/libgo/go/os/exec/exec.go +++ b/libgo/go/os/exec/exec.go @@ -55,8 +55,15 @@ type Cmd struct { // calling process's current directory. Dir string - // Stdin specifies the process's standard input. If Stdin is - // nil, the process reads from the null device (os.DevNull). + // Stdin specifies the process's standard input. + // If Stdin is nil, the process reads from the null device (os.DevNull). + // If Stdin is an *os.File, the process's standard input is connected + // directly to that file. + // Otherwise, during the execution of the command a separate + // goroutine reads from Stdin and delivers that data to the command + // over a pipe. In this case, Wait does not complete until the goroutine + // stops copying, either because it has reached the end of Stdin + // (EOF or a read error) or because writing to the pipe returned an error. Stdin io.Reader // Stdout and Stderr specify the process's standard output and error. @@ -358,7 +365,7 @@ func (c *Cmd) Wait() error { c.ProcessState = state var copyError error - for _ = range c.goroutine { + for range c.goroutine { if err := <-c.errch; err != nil && copyError == nil { copyError = err } |