Let's make sure we use the mtime of the current fstat() data, rather
than the mtime of the old stat(), fixing a theoretical race.
_cleanup_fclose_ FILE *f = NULL;
struct stat st;
char line[LINE_MAX];
- usec_t t;
int r;
assert(m);
}
/* Have we already seen the file? */
- t = timespec_load(&st.st_mtim);
- if (t == m->resolv_conf_mtime)
+ if (timespec_load(&st.st_mtim) == m->resolv_conf_mtime)
return 0;
if (file_is_our_own(&st))
}
}
- m->resolv_conf_mtime = t;
+ m->resolv_conf_mtime = timespec_load(&st.st_mtim);
/* Flush out all servers and search domains that are still
* marked. Those are then ones that didn't appear in the new