From 605814fc3aa291e29eb1126bf967c5dc5d8454b1 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 9 May 2019 09:57:09 +0200 Subject: service: account for delete pending windows bug in tunneltracker Sometimes deleting a service disables it and prepares it for being deleted, but doesn't actually mark it as pending deletion. Presumably this is due to a race condition in the service management code. Workaround this by polling for disabled services, so that we don't wind up sleeping forever. Reported-by: Thomas Gschwantner Signed-off-by: Jason A. Donenfeld --- service/zsyscall_windows.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'service/zsyscall_windows.go') diff --git a/service/zsyscall_windows.go b/service/zsyscall_windows.go index e8e035b7..38983370 100644 --- a/service/zsyscall_windows.go +++ b/service/zsyscall_windows.go @@ -270,21 +270,14 @@ func notifyServiceStatusChange(service windows.Handle, notifyMask uint32, notify return } -func sleepEx(milliseconds uint32, alertable bool) (ret uint32, err error) { +func sleepEx(milliseconds uint32, alertable bool) (ret uint32) { var _p0 uint32 if alertable { _p0 = 1 } else { _p0 = 0 } - r0, _, e1 := syscall.Syscall(procSleepEx.Addr(), 2, uintptr(milliseconds), uintptr(_p0), 0) + r0, _, _ := syscall.Syscall(procSleepEx.Addr(), 2, uintptr(milliseconds), uintptr(_p0), 0) ret = uint32(r0) - if ret == 0 { - if e1 != 0 { - err = errnoErr(e1) - } else { - err = syscall.EINVAL - } - } return } -- cgit v1.2.3-59-g8ed1b