aboutsummaryrefslogtreecommitdiff
path: root/sendusr1.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 /sendusr1.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 'sendusr1.go')
-rw-r--r--sendusr1.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/sendusr1.go b/sendusr1.go
index 5de8a6f..e61df23 100644
--- a/sendusr1.go
+++ b/sendusr1.go
@@ -1,9 +1,10 @@
package main
import (
- "fmt"
"os"
"syscall"
+
+ "github.com/rfjakob/gocryptfs/internal/toggledlog"
)
// Send signal USR1 to "pid" (usually our parent process). This notifies it
@@ -11,11 +12,11 @@ import (
func sendUsr1(pid int) {
p, err := os.FindProcess(pid)
if err != nil {
- fmt.Printf("sendUsr1: FindProcess: %v\n", err)
+ toggledlog.Warn.Printf("sendUsr1: FindProcess: %v\n", err)
return
}
err = p.Signal(syscall.SIGUSR1)
if err != nil {
- fmt.Printf("sendUsr1: Signal: %v\n", err)
+ toggledlog.Warn.Printf("sendUsr1: Signal: %v\n", err)
}
}