aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dirmngr/dns-stuff.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/dirmngr/dns-stuff.c b/dirmngr/dns-stuff.c
index a8ddbc64e..7324aae46 100644
--- a/dirmngr/dns-stuff.c
+++ b/dirmngr/dns-stuff.c
@@ -407,21 +407,23 @@ resolv_conf_changed_p (void)
static time_t last_mtime;
const char *fname = RESOLV_CONF_NAME;
struct stat statbuf;
- int changed;
+ int changed = 0;
if (stat (fname, &statbuf))
{
log_error ("stat'ing '%s' failed: %s\n",
fname, gpg_strerror (gpg_error_from_syserror ()));
- changed = 0;
last_mtime = 1; /* Force a "changed" result the next time stat
* works. */
}
- else
+ else if (!last_mtime)
+ last_mtime = statbuf.st_mtime;
+ else if (last_mtime != statbuf.st_mtime)
{
- changed = last_mtime && (last_mtime != statbuf.st_mtime);
+ changed = 1;
last_mtime = statbuf.st_mtime;
}
+
return changed;
#endif
}