2
2
mirror of https://github.com/octoleo/restic.git synced 2024-05-31 08:00:48 +00:00

lock: fix merge error, use processExists()

This commit is contained in:
Alexander Neumann 2015-08-19 21:14:15 +02:00
parent b8c0935f8a
commit 5d51c8ffcd

15
lock.go
View File

@ -207,17 +207,10 @@ func (l *Lock) Stale() bool {
return false return false
} }
proc, err := os.FindProcess(l.PID) // check if we can reach the process retaining the lock
defer proc.Release() exists := l.processExists()
if err != nil { if !exists {
debug.Log("Lock.Stale", "error searching for process %d: %v\n", l.PID, err) debug.Log("Lock.Stale", "could not reach process, %d, lock is probably stale\n", l.PID)
return true
}
debug.Log("Lock.Stale", "sending SIGHUP to process %d\n", l.PID)
err = proc.Signal(syscall.SIGHUP)
if err != nil {
debug.Log("Lock.Stale", "signal error: %v, lock is probably stale\n", err)
return true return true
} }