Create ignoreSigIntProcAttr()

Retrieve the SysProcAttr from a separate function. Completely eliminates syscall from main file.
This commit is contained in:
Klaus Post 2015-08-16 12:51:01 +02:00
parent 520b1b65b0
commit 0e7d0d8dba
3 changed files with 16 additions and 7 deletions

View file

@ -6,7 +6,8 @@ import (
"syscall"
)
func init() {
// ignore signals sent to the parent (e.g. SIGINT)
sysProcAttr = syscall.SysProcAttr{Setsid: true}
// ignoreSigIntProcAttr returns a syscall.SysProcAttr that
// disables SIGINT on parent.
func ignoreSigIntProcAttr() *syscall.SysProcAttr {
return &syscall.SysProcAttr{Setsid: true}
}