Change information
Commit message:
os/exec: second call to Cmd.Start is always an error
Previously it would return an error only if the first call
resulted in process creation, contra the intent of the
comment at exec.Cmd:
// A Cmd cannot be reused after calling its [Cmd.Start], [Cmd.Run],
// [Cmd.Output], or [Cmd.CombinedOutput] methods.
Also, clear the Cmd.goroutines slice in case of failure to
start a process, so that the closures can be GC'd and their
pipe fds finalized and closed.
Fixes #76746
Change-Id: Ic63a4dced0aa52c2d4be7d44f6dcfc84ee22282c
Files:
- M src/os/exec/exec.go
- M src/os/exec/exec_test.go
Change size: S
Delta: 2 files changed, 33 insertions(+), 1 deletion(-)
Branch: refs/heads/master
Submit Requirements:
Code-Review: +2 by Damien Neil
TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI