summaryrefslogtreecommitdiff
path: root/daemonize.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-05-07 22:15:01 +0200
committerJakob Unterwurzacher2017-05-07 22:16:22 +0200
commitd5adde1eeb13ba377f7c05b9f21893c01f61ec16 (patch)
tree011813ca5afd81ae6311bb007f5dc10ef69b2e7a /daemonize.go
parentad7942f434fea567f24458e67a0919291b5ec8dd (diff)
exitcodes: pull all exit code definitions into the package
This commit defines all exit codes in one place in the exitcodes package. Also, it adds a test to verify the exit code on incorrect password, which is what SiriKali cares about the most. Fixes https://github.com/rfjakob/gocryptfs/issues/77 .
Diffstat (limited to 'daemonize.go')
-rw-r--r--daemonize.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/daemonize.go b/daemonize.go
index 9869258..de09743 100644
--- a/daemonize.go
+++ b/daemonize.go
@@ -7,6 +7,7 @@ import (
"os/signal"
"syscall"
+ "github.com/rfjakob/gocryptfs/internal/exitcodes"
"github.com/rfjakob/gocryptfs/internal/tlog"
)
@@ -36,7 +37,7 @@ func forkChild() int {
err := c.Start()
if err != nil {
tlog.Fatal.Printf("forkChild: starting %s failed: %v\n", name, err)
- return 1
+ return exitcodes.ForkChild
}
err = c.Wait()
if err != nil {
@@ -46,7 +47,7 @@ func forkChild() int {
}
}
tlog.Fatal.Printf("forkChild: wait returned an unknown error: %v\n", err)
- return 1
+ return exitcodes.ForkChild
}
// The child exited with 0 - let's do the same.
return 0