Skip to content

Commit

Permalink
cmd.Process.Wait (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsnotify authored Feb 9, 2020
1 parent e54e0b3 commit f5010ec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion runner/util_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import (
func killCmd(cmd *exec.Cmd) (int, error) {
pid := cmd.Process.Pid
// https://stackoverflow.com/questions/22470193/why-wont-go-kill-a-child-process-correctly
err := syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL)
err := syscall.Kill(-pid, syscall.SIGKILL)

// Wait releases any resources associated with the Process.
_, _ = cmd.Process.Wait()

return pid, err
}

Expand Down

0 comments on commit f5010ec

Please sign in to comment.