aboutsummaryrefslogtreecommitdiff
path: root/daemonize.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-06-05 14:26:16 +0200
committerJakob Unterwurzacher2016-06-05 14:32:07 +0200
commit0c80cca674931c9dbfc69c25df24d53abbdd63a9 (patch)
treec11cae555954fc08f3e28f22b6ed23ea5717a083 /daemonize.go
parentca54b665e32a9b298ea3e70b5da0108db3a71364 (diff)
toggledlog: convert remaing naked fmt.Print*
Several fatal errors were just printed to stdout, which meant they were invisible when running the test suite. Fix this by introducing toggledlog.Fatal and convert as follows: Fatal errors -> toggledlog.Fatal Warnings -> toggledlog.Warn Password prompts -> fmt.Fprintf
Diffstat (limited to 'daemonize.go')
-rw-r--r--daemonize.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/daemonize.go b/daemonize.go
index e227942..5d570c6 100644
--- a/daemonize.go
+++ b/daemonize.go
@@ -6,6 +6,8 @@ import (
"os/exec"
"os/signal"
"syscall"
+
+ "github.com/rfjakob/gocryptfs/internal/toggledlog"
)
// The child sends us USR1 if the mount was successful
@@ -30,7 +32,7 @@ func forkChild() {
c.Stdin = os.Stdin
err := c.Start()
if err != nil {
- fmt.Printf("forkChild: starting %s failed: %v\n", name, err)
+ toggledlog.Fatal.Printf("forkChild: starting %s failed: %v\n", name, err)
os.Exit(1)
}
err = c.Wait()
@@ -40,7 +42,7 @@ func forkChild() {
os.Exit(waitstat.ExitStatus())
}
}
- fmt.Printf("forkChild: wait returned an unknown error: %v\n", err)
+ toggledlog.Fatal.Printf("forkChild: wait returned an unknown error: %v\n", err)
os.Exit(1)
}
// The child exited with 0 - let's do the same.