2015-10-06 00:29:08 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2015-10-07 22:58:22 +02:00
|
|
|
"os"
|
|
|
|
"syscall"
|
2016-06-05 14:26:16 +02:00
|
|
|
|
|
|
|
"github.com/rfjakob/gocryptfs/internal/toggledlog"
|
2015-10-06 00:29:08 +02:00
|
|
|
)
|
|
|
|
|
2015-11-09 23:21:11 +01:00
|
|
|
// 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)
|
2015-10-06 00:29:08 +02:00
|
|
|
if err != nil {
|
2016-06-05 14:26:16 +02:00
|
|
|
toggledlog.Warn.Printf("sendUsr1: FindProcess: %v\n", err)
|
2015-10-06 00:29:08 +02:00
|
|
|
return
|
|
|
|
}
|
2015-11-09 23:21:11 +01:00
|
|
|
err = p.Signal(syscall.SIGUSR1)
|
|
|
|
if err != nil {
|
2016-06-05 14:26:16 +02:00
|
|
|
toggledlog.Warn.Printf("sendUsr1: Signal: %v\n", err)
|
2015-10-06 00:29:08 +02:00
|
|
|
}
|
|
|
|
}
|