From 6cd825865134f630e048df6c8f1d56fad47cec01 Mon Sep 17 00:00:00 2001 From: Kevin Le Brun Date: Sun, 5 Apr 2015 23:20:21 +0200 Subject: [PATCH] Fix for OS X USR1 signal It seems that signals code for Linux and OS X (FreeBSD) are different. I rely on `syscall.SIGUSR1` which should be cross-compatible. Tested with `kill -usr1 ` on OS X 10.10 --- webhook.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webhook.go b/webhook.go index f4e3405..fec30e4 100644 --- a/webhook.go +++ b/webhook.go @@ -61,7 +61,7 @@ func init() { log.Printf("setting up os signal watcher\n") signals = make(chan os.Signal, 1) - signal.Notify(signals, syscall.Signal(0xa)) + signal.Notify(signals, syscall.SIGUSR1) go watchForSignals() @@ -258,7 +258,7 @@ func watchForSignals() { for { sig := <-signals - if sig == syscall.Signal(0xa) { + if sig == syscall.SIGUSR1 { log.Println("caught USR1 signal") reloadHooks()