summaryrefslogtreecommitdiff
path: root/worker.go
diff options
context:
space:
mode:
Diffstat (limited to 'worker.go')
-rw-r--r--worker.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/worker.go b/worker.go
index 6be841a9..58899e41 100644
--- a/worker.go
+++ b/worker.go
@@ -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
}
}