1
0
Fork 0
mirror of https://github.com/Luzifer/duplicity-backup.git synced 2024-12-21 02:51:21 +00:00
duplicity-backup/vendor/github.com/nightlyone/lockfile/lockfile_unix.go

21 lines
335 B
Go
Raw Normal View History

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