mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-01 11:15:59 +00:00
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
20 lines
299 B
Go
20 lines
299 B
Go
package signal
|
|
|
|
import (
|
|
"os"
|
|
"os/signal"
|
|
)
|
|
|
|
func CatchAll(sigc chan os.Signal) {
|
|
handledSigs := []os.Signal{}
|
|
for _, s := range SignalMap {
|
|
handledSigs = append(handledSigs, s)
|
|
}
|
|
signal.Notify(sigc, handledSigs...)
|
|
}
|
|
|
|
func StopCatch(sigc chan os.Signal) {
|
|
signal.Stop(sigc)
|
|
close(sigc)
|
|
}
|