From: Ian Lance Taylor Date: Wed, 15 Jan 2020 14:38:16 +0000 (-0800) Subject: [release-branch.go1.13] runtime: ignore power notification error seen on Windows... X-Git-Tag: go1.13.8~4 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=6d171bc7724ce30bb523b5c03601b92729b2d4c3;p=gostls13.git [release-branch.go1.13] runtime: ignore power notification error seen on Windows Docker Updates #36557 Fixes #36575 Change-Id: Ia8125f382d5e14e5612da811268a58971cc9ac08 Reviewed-on: https://go-review.googlesource.com/c/go/+/214917 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick Reviewed-by: Jason A. Donenfeld Reviewed-by: Austin Clements (cherry picked from commit d2de9bd59c068c1bfcb4293de4286196dacf2e43) Reviewed-on: https://go-review.googlesource.com/c/go/+/215002 --- diff --git a/src/runtime/os_windows.go b/src/runtime/os_windows.go index 6897933e30..2cf81f61a9 100644 --- a/src/runtime/os_windows.go +++ b/src/runtime/os_windows.go @@ -263,8 +263,9 @@ func loadOptionalSyscalls() { func monitorSuspendResume() { const ( - _DEVICE_NOTIFY_CALLBACK = 2 - _ERROR_FILE_NOT_FOUND = 2 + _DEVICE_NOTIFY_CALLBACK = 2 + _ERROR_FILE_NOT_FOUND = 2 + _ERROR_INVALID_PARAMETERS = 87 ) type _DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS struct { callback uintptr @@ -302,6 +303,10 @@ func monitorSuspendResume() { // also have their clock on "program time", and therefore // don't want or need this anyway. return + case _ERROR_INVALID_PARAMETERS: + // This is seen when running in Windows Docker. + // See issue 36557. + return default: println("runtime: PowerRegisterSuspendResumeNotification failed with errno=", ret) throw("runtime: PowerRegisterSuspendResumeNotification failure")