diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-05-09 09:57:09 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-05-09 13:31:05 +0200 |
commit | 605814fc3aa291e29eb1126bf967c5dc5d8454b1 (patch) | |
tree | fc22461957db09ce116489c49841681f1453b29e /service/zsyscall_windows.go | |
parent | ui: confview: recycle more peerviews (diff) | |
download | wireguard-windows-605814fc3aa291e29eb1126bf967c5dc5d8454b1.tar.xz wireguard-windows-605814fc3aa291e29eb1126bf967c5dc5d8454b1.zip |
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 <tharre3@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r-- | service/zsyscall_windows.go | 11 |
1 files changed, 2 insertions, 9 deletions
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 } |