libgocryptfs/sendusr1.go
Jakob Unterwurzacher 0c80cca674 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
2016-06-05 14:32:07 +02:00

23 lines
477 B
Go

package main
import (
"os"
"syscall"
"github.com/rfjakob/gocryptfs/internal/toggledlog"
)
// Send signal USR1 to "pid" (usually our parent process). This notifies it
// that the mounting has completed sucessfully.
func sendUsr1(pid int) {
p, err := os.FindProcess(pid)
if err != nil {
toggledlog.Warn.Printf("sendUsr1: FindProcess: %v\n", err)
return
}
err = p.Signal(syscall.SIGUSR1)
if err != nil {
toggledlog.Warn.Printf("sendUsr1: Signal: %v\n", err)
}
}