Commit 4af1337d authored by Ian Lance Taylor's avatar Ian Lance Taylor

[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 <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: default avatarAustin Clements <austin@google.com>
(cherry picked from commit d2de9bd5)
Reviewed-on: https://go-review.googlesource.com/c/go/+/215017
parent 9720aff0
...@@ -264,6 +264,7 @@ func monitorSuspendResume() { ...@@ -264,6 +264,7 @@ func monitorSuspendResume() {
const ( const (
_DEVICE_NOTIFY_CALLBACK = 2 _DEVICE_NOTIFY_CALLBACK = 2
_ERROR_FILE_NOT_FOUND = 2 _ERROR_FILE_NOT_FOUND = 2
_ERROR_INVALID_PARAMETERS = 87
) )
type _DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS struct { type _DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS struct {
callback uintptr callback uintptr
...@@ -301,6 +302,10 @@ func monitorSuspendResume() { ...@@ -301,6 +302,10 @@ func monitorSuspendResume() {
// also have their clock on "program time", and therefore // also have their clock on "program time", and therefore
// don't want or need this anyway. // don't want or need this anyway.
return return
case _ERROR_INVALID_PARAMETERS:
// This is seen when running in Windows Docker.
// See issue 36557.
return
default: default:
println("runtime: PowerRegisterSuspendResumeNotification failed with errno=", ret) println("runtime: PowerRegisterSuspendResumeNotification failed with errno=", ret)
throw("runtime: PowerRegisterSuspendResumeNotification failure") throw("runtime: PowerRegisterSuspendResumeNotification failure")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment