util/winutil: fix erroneous condition in implementation of getRegIntegerInternal

We only want to log when err != registry.ErrNotExist. The condition was backward.

Signed-off-by: Aaron Klotz <aaron@tailscale.com>
This commit is contained in:
Aaron Klotz 2022-12-19 13:37:55 -07:00
parent 14d07b7b20
commit 3c452b9880
1 changed files with 1 additions and 1 deletions

View File

@ -172,7 +172,7 @@ func deleteRegValueInternal(subKey, name string) error {
func getRegIntegerInternal(subKey, name string) (uint64, error) {
key, err := registry.OpenKey(registry.LOCAL_MACHINE, subKey, registry.READ)
if err != nil {
if err == registry.ErrNotExist {
if err != registry.ErrNotExist {
log.Printf("registry.OpenKey(%v): %v", subKey, err)
}
return 0, err