mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
157f24ca77
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
19 lines
299 B
Go
19 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)
|
|
}
|