mirror of
https://github.com/restic/restic.git
synced 2025-03-09 00:00:02 +01:00
Disable SUGHUP lock check on Windows.
This commit is contained in:
parent
f2fd632e30
commit
a260e82e6a
1 changed files with 9 additions and 5 deletions
14
lock.go
14
lock.go
|
@ -13,6 +13,7 @@ import (
|
|||
"github.com/restic/restic/backend"
|
||||
"github.com/restic/restic/debug"
|
||||
"github.com/restic/restic/repository"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
// Lock represents a process locking the repository for an operation.
|
||||
|
@ -209,11 +210,14 @@ func (l *Lock) Stale() bool {
|
|||
}
|
||||
defer proc.Release()
|
||||
|
||||
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
|
||||
// Windows does not have SIGHUP
|
||||
if runtime.GOOS != "windows" {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
debug.Log("Lock.Stale", "lock not stale\n")
|
||||
|
|
Loading…
Add table
Reference in a new issue