summaryrefslogtreecommitdiffstats
path: root/pkg/commands/os.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/commands/os.go')
-rw-r--r--pkg/commands/os.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/commands/os.go b/pkg/commands/os.go
index e85b3e19c..9cf266f58 100644
--- a/pkg/commands/os.go
+++ b/pkg/commands/os.go
@@ -401,3 +401,11 @@ func (c *OSCommand) PipeCommands(commandStrings ...string) error {
}
return nil
}
+
+func Kill(cmd *exec.Cmd) error {
+ if cmd.Process == nil {
+ // somebody got to it before we were able to, poor bastard
+ return nil
+ }
+ return cmd.Process.Kill()
+}