net/dns: resolveConfExists reading the wrong error

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
This commit is contained in:
David Crawshaw 2021-06-25 09:51:49 -07:00 committed by Brad Fitzpatrick
parent c1aa5a2e33
commit 0ac2130590

View File

@ -216,7 +216,8 @@ func (m directManager) restoreBackup() error {
if err != nil { if err != nil {
return err return err
} }
if _, err := m.fs.Stat(resolvConf); err != nil && !os.IsNotExist(err) { _, err = m.fs.Stat(resolvConf)
if err != nil && !os.IsNotExist(err) {
return err return err
} }
resolvConfExists := !os.IsNotExist(err) resolvConfExists := !os.IsNotExist(err)