From 0ac2130590624b9031390a70a3cf7a11d9028d1b Mon Sep 17 00:00:00 2001 From: David Crawshaw Date: Fri, 25 Jun 2021 09:51:49 -0700 Subject: [PATCH] net/dns: resolveConfExists reading the wrong error Signed-off-by: David Crawshaw --- net/dns/direct.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/dns/direct.go b/net/dns/direct.go index 879c62bbf..e8d9552cf 100644 --- a/net/dns/direct.go +++ b/net/dns/direct.go @@ -216,7 +216,8 @@ func (m directManager) restoreBackup() error { if err != nil { 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 } resolvConfExists := !os.IsNotExist(err)