mirror of
https://github.com/Twigpine/zero.git
synced 2026-11-11 23:40:28 -10:00
21 lines
337 B
Go
21 lines
337 B
Go
//go:build !windows
|
|
|
|
package config
|
|
|
|
import (
|
|
"os/exec"
|
|
"syscall"
|
|
)
|
|
|
|
func configureCommandProcess(cmd *exec.Cmd) {
|
|
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
|
|
}
|
|
|
|
func terminateCommandProcess(cmd *exec.Cmd) {
|
|
if cmd.Process == nil {
|
|
return
|
|
}
|
|
_ = syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL)
|
|
_ = cmd.Process.Kill()
|
|
}
|