mirror of
https://github.com/containers/skopeo.git
synced 2025-04-27 19:05:32 +00:00
To fix compilation on MacOS. I think actually we want to use this pervasively in our tests on Linux; it doesn't really matter when run inside a transient container, but `PDEATHSIG` is useful for persistent containers (e.g.) toolbox and when running outside of a pid namespace, e.g. on a host system shell directly or in systemd. Signed-off-by: Colin Walters <walters@verbum.org>
15 lines
268 B
Go
15 lines
268 B
Go
package main
|
|
|
|
import (
|
|
"os/exec"
|
|
"syscall"
|
|
)
|
|
|
|
// cmdLifecyleToParentIfPossible is a thin wrapper around prctl(PR_SET_PDEATHSIG)
|
|
// on Linux.
|
|
func cmdLifecycleToParentIfPossible(c *exec.Cmd) {
|
|
c.SysProcAttr = &syscall.SysProcAttr{
|
|
Pdeathsig: syscall.SIGTERM,
|
|
}
|
|
}
|