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
|
|
|
|
2016-06-15 23:30:44 +02:00
|
|
|
"github.com/rfjakob/gocryptfs/internal/tlog"
|
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
|
2016-10-24 19:18:13 +02:00
|
|
|
// that the mounting has completed successfully.
|
2015-11-09 23:21:11 +01:00
|
|
|
func sendUsr1(pid int) {
|
|
|
|
p, err := os.FindProcess(pid)
|
2015-10-06 00:29:08 +02:00
|
|
|
if err != nil {
|
2016-06-15 23:30:44 +02:00
|
|
|
tlog.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-15 23:30:44 +02:00
|
|
|
tlog.Warn.Printf("sendUsr1: Signal: %v\n", err)
|
2015-10-06 00:29:08 +02:00
|
|
|
}
|
|
|
|
}
|