From d5adde1eeb13ba377f7c05b9f21893c01f61ec16 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 7 May 2017 22:15:01 +0200 Subject: 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 . --- daemonize.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'daemonize.go') 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 -- cgit v1.2.3