Skip to content

Commit d2de9bd

Browse files
runtime: ignore power notification error seen on Windows Docker
Fixes #36557 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]>
1 parent f77e7ed commit d2de9bd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/runtime/os_windows.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,9 @@ func loadOptionalSyscalls() {
294294

295295
func monitorSuspendResume() {
296296
const (
297-
_DEVICE_NOTIFY_CALLBACK = 2
298-
_ERROR_FILE_NOT_FOUND = 2
297+
_DEVICE_NOTIFY_CALLBACK = 2
298+
_ERROR_FILE_NOT_FOUND = 2
299+
_ERROR_INVALID_PARAMETERS = 87
299300
)
300301
type _DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS struct {
301302
callback uintptr
@@ -333,6 +334,10 @@ func monitorSuspendResume() {
333334
// also have their clock on "program time", and therefore
334335
// don't want or need this anyway.
335336
return
337+
case _ERROR_INVALID_PARAMETERS:
338+
// This is seen when running in Windows Docker.
339+
// See issue 36557.
340+
return
336341
default:
337342
println("runtime: PowerRegisterSuspendResumeNotification failed with errno=", ret)
338343
throw("runtime: PowerRegisterSuspendResumeNotification failure")

0 commit comments

Comments
 (0)