Make docker use the signal pkg with strings

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
This commit is contained in:
Guillaume J. Charmes 2014-03-10 14:22:27 -07:00
parent 16d0b6b959
commit 2433bf6372
5 changed files with 36 additions and 36 deletions

View file

@ -7,7 +7,7 @@ import (
func CatchAll(sigc chan os.Signal) { func CatchAll(sigc chan os.Signal) {
handledSigs := []os.Signal{} handledSigs := []os.Signal{}
for _, s := range signalMap { for _, s := range SignalMap {
handledSigs = append(handledSigs, s) handledSigs = append(handledSigs, s)
} }
signal.Notify(sigc, handledSigs...) signal.Notify(sigc, handledSigs...)

View file

@ -4,37 +4,37 @@ import (
"syscall" "syscall"
) )
var signalMap = map[string]syscall.Signal{ var SignalMap = map[string]syscall.Signal{
"ABRT": syscall.SIGABRT, "ABRT": syscall.SIGABRT,
"ALRM": syscall.SIGALRM, "ALRM": syscall.SIGALRM,
"BUG": syscall.SIGBUS, "BUG": syscall.SIGBUS,
"CHLD": syscall.SIGCHLD, "CHLD": syscall.SIGCHLD,
"CONT": syscall.SIGCONT, "CONT": syscall.SIGCONT,
"EMT": syscall.SIGEMT, "EMT": syscall.SIGEMT,
"FPE": syscall.SIGFPE, "FPE": syscall.SIGFPE,
"HUP": syscall.SIGHUP, "HUP": syscall.SIGHUP,
"ILL": syscall.SIGILL, "ILL": syscall.SIGILL,
"INFO": syscall.SIGINFO, "INFO": syscall.SIGINFO,
"INT": syscall.SIGINT, "INT": syscall.SIGINT,
"IO": syscall.SIGIO, "IO": syscall.SIGIO,
"IOT": syscall.SIGIOT, "IOT": syscall.SIGIOT,
"KILL": syscall.SIGKILL, "KILL": syscall.SIGKILL,
"PIPE": syscall.SIGPIPE, "PIPE": syscall.SIGPIPE,
"PROF": syscall.SIGPROF, "PROF": syscall.SIGPROF,
"QUIT": syscall.SIGQUIT, "QUIT": syscall.SIGQUIT,
"SEGV": syscall.SIGSEGV, "SEGV": syscall.SIGSEGV,
"STOP": syscall.SIGSTOP, "STOP": syscall.SIGSTOP,
"SYS": syscall.SIGSYS, "SYS": syscall.SIGSYS,
"TERM": syscall.SIGTERM, "TERM": syscall.SIGTERM,
"TRAP": syscall.SIGTRAP, "TRAP": syscall.SIGTRAP,
"TSTP": syscall.SIGTSTP, "TSTP": syscall.SIGTSTP,
"TTIN": syscall.SIGTTIN, "TTIN": syscall.SIGTTIN,
"TTOU": syscall.SIGTTOU, "TTOU": syscall.SIGTTOU,
"URG": syscall.SIGURG, "URG": syscall.SIGURG,
"USR1": syscall.SIGUSR1, "USR1": syscall.SIGUSR1,
"USR2": syscall.SIGUSR2, "USR2": syscall.SIGUSR2,
"VTALRM": syscall.SIGVTALRM, "VTALRM": syscall.SIGVTALRM,
"WINCH": syscall.SIGWINCH, "WINCH": syscall.SIGWINCH,
"XCPU": syscall.SIGXCPU, "XCPU": syscall.SIGXCPU,
"XFSZ": syscall.SIGXFSZ, "XFSZ": syscall.SIGXFSZ,
} }

View file

@ -6,7 +6,7 @@ import (
"syscall" "syscall"
) )
var signalMap = map[string]syscall.Signal{ var SignalMap = map[string]syscall.Signal{
"ABRT": syscall.SIGABRT, "ABRT": syscall.SIGABRT,
"ALRM": syscall.SIGALRM, "ALRM": syscall.SIGALRM,
"BUF": syscall.SIGBUS, "BUF": syscall.SIGBUS,

View file

@ -4,7 +4,7 @@ import (
"syscall" "syscall"
) )
var signalMap = map[string]syscall.Signal{ var SignalMap = map[string]syscall.Signal{
"ABRT": syscall.SIGABRT, "ABRT": syscall.SIGABRT,
"ALRM": syscall.SIGALRM, "ALRM": syscall.SIGALRM,
"BUS": syscall.SIGBUS, "BUS": syscall.SIGBUS,

View file

@ -6,4 +6,4 @@ import (
"syscall" "syscall"
) )
var signalMap = map[string]syscall.Signal{} var SignalMap = map[string]syscall.Signal{}