Fix error on doulbe Kill calls

This returns a typed error for calls to Kill when the process has
already finished.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-06-14 16:11:51 -07:00
parent 8d9ccd646b
commit 3b9d9dfa3e
8 changed files with 112 additions and 18 deletions

View File

@@ -167,7 +167,10 @@ func (e *execProcess) Resize(ws console.WinSize) error {
}
func (e *execProcess) Signal(sig int) error {
return unix.Kill(e.pid, syscall.Signal(sig))
if err := unix.Kill(e.pid, syscall.Signal(sig)); err != nil {
return checkKillError(err)
}
return nil
}
func (e *execProcess) Stdin() io.Closer {