mirror of
https://github.com/kopia/kopia.git
synced 2026-05-11 00:04:46 -04:00
Remove unnecessary intermediate variables. Send SIGTERM instead of SIGKILL to terminate child kopia server process. Set Pdeathsig on Linux for child kopia server process. Trivial: reduce scope of hostFioDataPathStr variable. Trivial: rename local variable. Trivial: Use log.Fatalln instead of log + exit(1). Improve error message in robustness test to tell apart failure cause.
21 lines
255 B
Go
21 lines
255 B
Go
package kopiarunner
|
|
|
|
import (
|
|
"os/exec"
|
|
"syscall"
|
|
)
|
|
|
|
func setpdeath(c *exec.Cmd) *exec.Cmd {
|
|
if c == nil {
|
|
return nil
|
|
}
|
|
|
|
if c.SysProcAttr == nil {
|
|
c.SysProcAttr = &syscall.SysProcAttr{}
|
|
}
|
|
|
|
c.SysProcAttr.Pdeathsig = syscall.SIGTERM
|
|
|
|
return c
|
|
}
|