storj/internal/processgroup/kill_fallback.go

25 lines
467 B
Go
Raw Normal View History

2018-09-11 14:57:12 +01:00
// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information
// +build !windows,!linux,!darwin,!netbsd,!freebsd,!openbsd
package processgroup
import (
"os"
"os/exec"
)
// Setup sets up exec.Cmd such that it can be properly terminated
func Setup(c *exec.Cmd) {}
// Kill tries to forcefully kill the process
func Kill(cmd *exec.Cmd) {
proc := cmd.Process
if proc == nil {
return
}
_ = proc.Signal(os.Interrupt)
_ = proc.Signal(os.Kill)
}