Skip to content

Commit

Permalink
[release-branch.go1.13] runtime: ignore power notification error seen…
Browse files Browse the repository at this point in the history
… 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 <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Austin Clements <austin@google.com>
(cherry picked from commit d2de9bd)
Reviewed-on: https://go-review.googlesource.com/c/go/+/215002
ianlancetaylor committed Jan 16, 2020
1 parent 14b79df commit 6d171bc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/runtime/os_windows.go
Original file line number Diff line number Diff line change
@@ -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")

0 comments on commit 6d171bc

Please sign in to comment.