mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-05 23:07:44 +00:00
util/winutil: remove log spam for missing registry keys
It's normal for HKLM\SOFTWARE\Policies\Tailscale to not exist but that currently produces a lot of log spam. Signed-off-by: Adrian Dewhurst <adrian@tailscale.com>
This commit is contained in:
parent
76904b82e7
commit
c3a5489e72
@ -82,7 +82,9 @@ func getRegInteger(name string, defval uint64) uint64 {
|
||||
func getRegStringInternal(subKey, name string) (string, error) {
|
||||
key, err := registry.OpenKey(registry.LOCAL_MACHINE, subKey, registry.READ)
|
||||
if err != nil {
|
||||
log.Printf("registry.OpenKey(%v): %v", subKey, err)
|
||||
if err != registry.ErrNotExist {
|
||||
log.Printf("registry.OpenKey(%v): %v", subKey, err)
|
||||
}
|
||||
return "", err
|
||||
}
|
||||
defer key.Close()
|
||||
@ -110,7 +112,9 @@ func GetRegStrings(name string, defval []string) []string {
|
||||
func getRegStringsInternal(subKey, name string) ([]string, error) {
|
||||
key, err := registry.OpenKey(registry.LOCAL_MACHINE, subKey, registry.READ)
|
||||
if err != nil {
|
||||
log.Printf("registry.OpenKey(%v): %v", subKey, err)
|
||||
if err != registry.ErrNotExist {
|
||||
log.Printf("registry.OpenKey(%v): %v", subKey, err)
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
defer key.Close()
|
||||
@ -148,6 +152,9 @@ func DeleteRegValue(name string) error {
|
||||
|
||||
func deleteRegValueInternal(subKey, name string) error {
|
||||
key, err := registry.OpenKey(registry.LOCAL_MACHINE, subKey, registry.SET_VALUE)
|
||||
if err == registry.ErrNotExist {
|
||||
return nil
|
||||
}
|
||||
if err != nil {
|
||||
log.Printf("registry.OpenKey(%v): %v", subKey, err)
|
||||
return err
|
||||
@ -164,7 +171,9 @@ 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 {
|
||||
log.Printf("registry.OpenKey(%v): %v", subKey, err)
|
||||
if err == registry.ErrNotExist {
|
||||
log.Printf("registry.OpenKey(%v): %v", subKey, err)
|
||||
}
|
||||
return 0, err
|
||||
}
|
||||
defer key.Close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user