1
0
Fork 0
mirror of https://github.com/Luzifer/duplicity-backup.git synced 2024-11-14 09:52:53 +00:00
duplicity-backup/vendor/github.com/nightlyone/lockfile/lockfile_unix.go
Knut Ahlers 6275a80c3f
Deps: Update dependencies
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2018-10-08 15:14:49 +02:00

20 lines
335 B
Go

// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris aix
package lockfile
import (
"os"
"syscall"
)
func isRunning(pid int) (bool, error) {
proc, err := os.FindProcess(pid)
if err != nil {
return false, err
}
if err := proc.Signal(syscall.Signal(0)); err != nil {
return false, nil
}
return true, nil
}