summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-09-12 13:49:36 +0000
committerLaurent Bercot <ska@appnovation.com>2023-09-12 13:49:36 +0000
commit919a8f8e32f7926a2a026e5f5671b45ac1e2214e (patch)
tree47b070c4b17d4699f12041048e0486ad883d5ddd /src
parenta1f1d3271002effba330a4c92bdb45d8539d1a00 (diff)
downloads6-dns-919a8f8e32f7926a2a026e5f5671b45ac1e2214e.tar.xz
Support Darwin snowflakiness with st_mtim
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src')
-rw-r--r--src/libs6dns/s6dns_hosts_init.c6
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) ;
}