]> Cypherpunks repositories - gostls13.git/commit
runtime: ignore error returned by PowerRegisterSuspendResumeNotification
authorAlex Brainman <alex.brainman@gmail.com>
Sun, 16 Feb 2020 01:01:02 +0000 (12:01 +1100)
committerAlex Brainman <alex.brainman@gmail.com>
Sat, 21 Mar 2020 06:00:19 +0000 (06:00 +0000)
commitd467f3bbc9c76805ae16ab1924c28ec3be487875
tree2ad30f57770b4553c3f84a385978eb03519382d7
parent287d67e3dd3972b1d1006b06e0d57929540a1591
runtime: ignore error returned by PowerRegisterSuspendResumeNotification

It appears that PowerRegisterSuspendResumeNotification is not supported
when running inside Docker - see issues #35447, #36557 and #37149.

Our current code relies on error number to determine Docker environment.
But we already saw PowerRegisterSuspendResumeNotification return
ERROR_FILE_NOT_FOUND, ERROR_INVALID_PARAMETERS and ERROR_ACCESS_DENIED
(see issues above). So this approach is not sustainable.

Just ignore PowerRegisterSuspendResumeNotification returned error.

Fixes #37149

Change-Id: I2beba9d45cdb8c1efac5e974e747827a6261915a
Reviewed-on: https://go-review.googlesource.com/c/go/+/219657
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
src/runtime/os_windows.go