libgocryptfs/sendusr1.go

23 lines
477 B
Go
Raw Normal View History

package main
import (
2015-10-07 22:58:22 +02:00
"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)
}
}