summaryrefslogtreecommitdiff
path: root/src/pkg/os/exec_unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/os/exec_unix.go')
-rw-r--r--src/pkg/os/exec_unix.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pkg/os/exec_unix.go b/src/pkg/os/exec_unix.go
index cf5ea9b61..8a4b2e1b8 100644
--- a/src/pkg/os/exec_unix.go
+++ b/src/pkg/os/exec_unix.go
@@ -38,6 +38,9 @@ func (p *Process) Wait(options int) (w *Waitmsg, err Error) {
if e != 0 {
return nil, NewSyscallError("wait", e)
}
+ if options&WSTOPPED == 0 {
+ p.done = true
+ }
w = new(Waitmsg)
w.Pid = pid1
w.WaitStatus = status
@@ -47,6 +50,9 @@ func (p *Process) Wait(options int) (w *Waitmsg, err Error) {
// Signal sends a signal to the Process.
func (p *Process) Signal(sig Signal) Error {
+ if p.done {
+ return NewError("os: process already finished")
+ }
if e := syscall.Kill(p.Pid, int(sig.(UnixSignal))); e != 0 {
return Errno(e)
}