added _linux signals

This commit is contained in:
Cam Otts 2023-04-19 12:21:31 -05:00
parent 1c245e2f31
commit 3b06dd6cf3
No known key found for this signature in database
GPG Key ID: 367B7C7EBD84A8BD
2 changed files with 17 additions and 0 deletions

14
cmd/zrok/signals_linux.go Normal file
View File

@ -0,0 +1,14 @@
package main
import (
"os"
"os/signal"
"golang.org/x/sys/unix"
)
func newSignalHandler() chan os.Signal {
signalHandler := make(chan os.Signal, 1)
signal.Notify(signalHandler, unix.SIGINT, unix.SIGTERM, unix.SIGHUP, unix.SIGQUIT)
return signalHandler
}

View File

@ -1,6 +1,9 @@
package main
import (
"os"
"os/signal"
"golang.org/x/sys/windows"
)