Skip to content

Commit 4af1337

Browse files
[release-branch.go1.12] runtime: ignore power notification error seen on Windows Docker
Updates #36557 Fixes #36574 Change-Id: Ia8125f382d5e14e5612da811268a58971cc9ac08 Reviewed-on: https://go-review.googlesource.com/c/go/+/214917 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> Reviewed-by: Jason A. Donenfeld <[email protected]> Reviewed-by: Austin Clements <[email protected]> (cherry picked from commit d2de9bd) Reviewed-on: https://go-review.googlesource.com/c/go/+/215017
1 parent 9720aff commit 4af1337

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/runtime/os_windows.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,9 @@ func loadOptionalSyscalls() {
262262

263263
func monitorSuspendResume() {
264264
const (
265-
_DEVICE_NOTIFY_CALLBACK = 2
266-
_ERROR_FILE_NOT_FOUND = 2
265+
_DEVICE_NOTIFY_CALLBACK = 2
266+
_ERROR_FILE_NOT_FOUND = 2
267+
_ERROR_INVALID_PARAMETERS = 87
267268
)
268269
type _DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS struct {
269270
callback uintptr
@@ -301,6 +302,10 @@ func monitorSuspendResume() {
301302
// also have their clock on "program time", and therefore
302303
// don't want or need this anyway.
303304
return
305+
case _ERROR_INVALID_PARAMETERS:
306+
// This is seen when running in Windows Docker.
307+
// See issue 36557.
308+
return
304309
default:
305310
println("runtime: PowerRegisterSuspendResumeNotification failed with errno=", ret)
306311
throw("runtime: PowerRegisterSuspendResumeNotification failure")

0 commit comments

Comments
 (0)