libgocryptfs/sendusr1.go
Jakob Unterwurzacher 69d88505fd go mod: declare module version v2
Our git version is v2+ for some time now, but go.mod
still declared v1. Hopefully making both match makes
https://pkg.go.dev/github.com/rfjakob/gocryptfs/v2 work.

All the import paths have been fixed like this:

  find . -name \*.go | xargs sed -i s%github.com/rfjakob/gocryptfs/%github.com/rfjakob/gocryptfs/v2/%
2021-08-23 15:05:15 +02:00

23 lines
463 B
Go

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