[core] use high precision stat timestamp on OS X

This commit is contained in:
Glenn Strauss 2019-05-13 01:45:42 -04:00
parent d5774fc6b3
commit 42942ec97c
1 changed files with 4 additions and 0 deletions

View File

@ -161,8 +161,12 @@ int etag_create(buffer *etag, const struct stat *st, etag_flags_t flags) {
if (flags & ETAG_USE_MTIME) {
buffer_append_int(etag, st->st_mtime);
#ifdef st_mtime /* use high-precision timestamp if available */
#if defined(__APPLE__) && defined(__MACH__)
buffer_append_int(etag, st->st_mtimespec.tv_nsec);
#else
buffer_append_int(etag, st->st_mtim.tv_nsec);
#endif
#endif
}
return 0;