1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-16 00:00:05 +01:00

Don't defer until we have checked the error.

This commit is contained in:
klauspost 2015-08-12 15:57:18 +02:00
parent 9f9c2a2be0
commit 0fb1ad40f2

View file

@ -203,11 +203,11 @@ func (l *Lock) Stale() bool {
}
proc, err := os.FindProcess(l.PID)
defer proc.Release()
if err != nil {
debug.Log("Lock.Stale", "error searching for process %d: %v\n", l.PID, err)
return true
}
defer proc.Release()
debug.Log("Lock.Stale", "sending SIGHUP to process %d\n", l.PID)
err = proc.Signal(syscall.SIGHUP)