2015-08-16 11:16:02 +00:00
|
|
|
package restic
|
|
|
|
|
|
|
|
import (
|
2015-08-16 13:30:36 +00:00
|
|
|
"os"
|
2015-08-16 11:16:02 +00:00
|
|
|
"os/user"
|
2015-08-16 13:30:36 +00:00
|
|
|
|
2016-02-14 14:29:28 +00:00
|
|
|
"restic/debug"
|
2015-08-16 11:16:02 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// uidGidInt always returns 0 on Windows, since uid isn't numbers
|
|
|
|
func uidGidInt(u user.User) (uid, gid uint32, err error) {
|
|
|
|
return 0, 0, nil
|
|
|
|
}
|
2015-08-16 13:30:36 +00:00
|
|
|
|
|
|
|
// checkProcess will check if the process retaining the lock exists.
|
|
|
|
// Returns true if the process exists.
|
|
|
|
func (l Lock) processExists() bool {
|
|
|
|
proc, err := os.FindProcess(l.PID)
|
|
|
|
if err != nil {
|
2016-09-27 20:35:08 +00:00
|
|
|
debug.Log("error searching for process %d: %v\n", l.PID, err)
|
2015-08-16 13:30:36 +00:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
proc.Release()
|
|
|
|
return true
|
|
|
|
}
|