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>
pull/6790/head
Aaron Klotz 2 years ago
parent 14d07b7b20
commit 3c452b9880

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

Loading…
Cancel
Save