From 2646fd116b18fd9a6829f9a879ae07ee40d4d1e8 Mon Sep 17 00:00:00 2001 From: nbari Date: Tue, 30 Aug 2016 15:38:52 +0200 Subject: [PATCH] reorder signals (need to mock to be available to chance the default) --- a_test.go | 6 +++--- signals.go | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/a_test.go b/a_test.go index 7ceb3dc..cd12f2b 100644 --- a/a_test.go +++ b/a_test.go @@ -14,8 +14,8 @@ func expect(t *testing.T, a interface{}, b interface{}) { } } -type myFork struct{} +type mockProcess struct { +} -func (self myFork) Fork() (int, error) { - return 0, nil +func (m *mockProcess) Start() { } diff --git a/signals.go b/signals.go index f22c58e..29bc7b5 100644 --- a/signals.go +++ b/signals.go @@ -9,14 +9,6 @@ import ( func (s *Sup) HandleSignals(signal string, d *Daemon) { var err error switch signal { - // 1: USR1. Send the service a USR1 signal. - case "1", "usr1": - err = s.process.Signal(syscall.SIGUSR1) - - // 2: USR2. Send the service a USR2 signal. - case "2", "usr2": - err = s.process.Signal(syscall.SIGUSR2) - // a: Alarm. Send the service an ALRM signal. case "a", "alrm": err = s.process.Signal(syscall.SIGALRM) @@ -71,6 +63,14 @@ func (s *Sup) HandleSignals(signal string, d *Daemon) { d.lock = 0 d.lock_once = 0 + // 1: USR1. Send the service a USR1 signal. + case "1", "usr1": + err = s.process.Signal(syscall.SIGUSR1) + + // 2: USR2. Send the service a USR2 signal. + case "2", "usr2": + err = s.process.Signal(syscall.SIGUSR2) + // w: WINCH. Send the service a WINCH signal. case "w", "winch": err = s.process.Signal(syscall.SIGWINCH)