File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -38,9 +38,15 @@ static int apply_timestamp(const char *path, struct timespec *ts) {
3838 assert (ts );
3939
4040 if (stat (path , & st ) >= 0 ) {
41- /* Is the timestamp file already newer than the OS? If so, there's nothing to do. */
42- if (st .st_mtim .tv_sec > ts -> tv_sec ||
43- (st .st_mtim .tv_sec == ts -> tv_sec && st .st_mtim .tv_nsec >= ts -> tv_nsec ))
41+ /* Is the timestamp file already newer than the OS? If
42+ * so, there's nothing to do. We ignore the nanosecond
43+ * component of the timestamp, since some file systems
44+ * do not support any better accuracy than 1s and we
45+ * have no way to identify the accuracy
46+ * available. Most notably ext4 on small disks (where
47+ * 128 byte inodes are used) does not support better
48+ * accuracy than 1s. */
49+ if (st .st_mtim .tv_sec > ts -> tv_sec )
4450 return 0 ;
4551
4652 /* It is older? Then let's update it */
You can’t perform that action at this time.
0 commit comments