diff options
Diffstat (limited to 'worker.go')
-rw-r--r-- | worker.go | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -10,6 +10,7 @@ import ( "strconv" "strings" "sync" + "syscall" "time" ) @@ -105,8 +106,13 @@ func (w *Worker) Wait() error { if runtime.GOOS != "windows" { // windows handles processes and close pipes differently, // we can ignore wait here as process.Wait() already being handled above - err := w.cmd.Wait() + var ws syscall.WaitStatus + _, err := syscall.Wait4(w.cmd.Process.Pid, &ws, syscall.WALL, nil) if err != nil { + if ws.Exited() { + return nil + } + } else { return err } } |