diff options
Diffstat (limited to 'src/libs6dns/s6dns_hosts_init.c')
-rw-r--r-- | src/libs6dns/s6dns_hosts_init.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libs6dns/s6dns_hosts_init.c b/src/libs6dns/s6dns_hosts_init.c index 8f78ab1..093b5b8 100644 --- a/src/libs6dns/s6dns_hosts_init.c +++ b/src/libs6dns/s6dns_hosts_init.c @@ -9,10 +9,13 @@ #include <skalibs/posixplz.h> #include <skalibs/cdb.h> +#include <skalibs/djbtime.h> #include <skalibs/djbunix.h> #include <s6-dns/hosts.h> +#include <skalibs/posixishard.h> + int s6dns_hosts_init (cdb *c, char const *txtfile, char const *cdbfile, char const *tmpprefix) { int fdr ; @@ -26,8 +29,7 @@ int s6dns_hosts_init (cdb *c, char const *txtfile, char const *cdbfile, char con if (errno == ENOENT) goto useit ; else goto errc ; } - if (stc.st_mtim.tv_sec > str.st_mtim.tv_sec - || (stc.st_mtim.tv_sec == str.st_mtim.tv_sec && stc.st_mtim.tv_nsec > str.st_mtim.tv_nsec)) goto useit ; + if (timespec_cmp(&stc.ST_MTIM, &str.ST_MTIM) > 0) goto useit ; fd_close(fdc) ; } |