summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2019-05-13 01:45:42 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2019-05-13 21:01:57 -0400
commit42942ec97c591b716724209cbe553273d086b4b6 (patch)
treebb5610d9a2068f82f463cc9c5f62fecb2ee0fe8d
parentd5774fc6b3a979975aefc3da837a94ae0015c46e (diff)
downloadlighttpd1.4-42942ec97c591b716724209cbe553273d086b4b6.tar.gz
lighttpd1.4-42942ec97c591b716724209cbe553273d086b4b6.zip
[core] use high precision stat timestamp on OS X
-rw-r--r--src/etag.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/etag.c b/src/etag.c
index a89c4e51..002b8e0b 100644
--- a/src/etag.c
+++ b/src/etag.c
@@ -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;