Skip to content

Commit

Permalink
reorder signals (need to mock to be available to chance the default)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbari committed Aug 30, 2016
1 parent f05da42 commit 2646fd1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions a_test.go
Expand Up @@ -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() {
}
16 changes: 8 additions & 8 deletions signals.go
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 2646fd1

Please sign in to comment.