From ce8a1be8d98608e1cec6b714c916c6abcd690761 Mon Sep 17 00:00:00 2001 From: astaxie Date: Sat, 7 Dec 2013 16:52:39 +0800 Subject: [PATCH] change syscall package to os.Kill --- reload.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reload.go b/reload.go index 62e21782..0087765d 100644 --- a/reload.go +++ b/reload.go @@ -12,7 +12,7 @@ import ( "reflect" "strconv" "sync" - "syscall" + //"syscall" ) const ( @@ -82,15 +82,15 @@ func (sl *stoppableListener) Accept() (c net.Conn, err error) { func WaitSignal(l net.Listener) error { ch := make(chan os.Signal, 1) - signal.Notify(ch, syscall.SIGTERM, syscall.SIGHUP) + signal.Notify(ch, os.Interrupt, os.Kill) for { sig := <-ch log.Println(sig.String()) switch sig { - case syscall.SIGTERM: + case os.Kill: return nil - case syscall.SIGHUP: + case os.Interrupt: err := Restart(l) if nil != err { return err