mirror of
https://github.com/Luzifer/duplicity-backup.git
synced 2024-11-14 09:52:53 +00:00
20 lines
335 B
Go
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
|
|
}
|