Terminate file playback process groups

This commit is contained in:
Brandon McGinty (chatgpt)
2026-08-10 10:25:25 -04:00
committed by Brandon McGinty
parent 1d6ab79ed0
commit cf9e1c6d0a
4 changed files with 56 additions and 2 deletions
+19
View File
@@ -0,0 +1,19 @@
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
package fileplayback
import (
"os/exec"
"syscall"
)
func configureProcessGroup(cmd *exec.Cmd) {
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
}
func terminateProcessGroup(cmd *exec.Cmd) {
if cmd == nil || cmd.Process == nil {
return
}
_ = syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL)
}