mirror of
https://github.com/google/brotli.git
synced 2026-09-23 23:24:59 +00:00
HAVE_UTIMENSAT was only set when _POSIX_C_SOURCE >= 200809L or _ATFILE_SOURCE was defined. FreeBSD, OpenBSD, NetBSD and DragonFly BSD provide utimensat()/futimens() and nanosecond-resolution stat timestamps by default without defining either macro, so the CLI fell back to utime() and truncated the copied mtime to whole seconds (visible as .br files with a .000000000 nanosecond field next to the source). Detect those platforms explicitly. The existing non-Apple ATIME_NSEC / MTIME_NSEC macros already use the st_atim / st_mtim spelling that the BSDs expose, so no further change is needed.