From a260e82e6ac29571cf159bdaa2b36f12b52769f3 Mon Sep 17 00:00:00 2001 From: klauspost Date: Thu, 13 Aug 2015 14:10:32 +0200 Subject: [PATCH] Disable SUGHUP lock check on Windows. --- lock.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lock.go b/lock.go index 4e195cdda..767f21511 100644 --- a/lock.go +++ b/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")