Skip to content

Commit 6d171bc

Browse files
[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 <[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/+/215002
1 parent 14b79df commit 6d171bc

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
@@ -263,8 +263,9 @@ func loadOptionalSyscalls() {
263263

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

0 commit comments

Comments
 (0)