1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/pkg/signal/signal.go

20 lines
299 B
Go
Raw Normal View History

package signal
2013-10-29 14:59:08 -04:00
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...)
}
2013-10-29 14:59:08 -04:00
func StopCatch(sigc chan os.Signal) {
signal.Stop(sigc)
close(sigc)
}