Jeff King [off-list ref] writes:
On Wed, Apr 15, 2020 at 11:09:06AM +0200, luciano.rocha@booking.com wrote:
quoted
quoted
The old code was setting the time based on the system time from time().
We've occasionally hit cases where the filesystem time and the system
time do not match exactly (this might be true on an NFS mount, for
example).
It's not clear to me whether utime(NULL) would be using the system or
filesystem time in such a case. If the former, then there's no change in
behavior. If the latter, I'd argue that it's probably an _improvement_,
since we're simulating the case that we wrote a new file with a new
mtime.
I'm not that familiar with kernel code, so can't say for sure. From a
cursory look, it doesn't seem like it uses the remote server's time.
But it does seem to have a higher precision, for filesystems that
support it.
Yeah, that's another point in its favor.
It seems pretty clear to me that utime(NULL) should give either the same
or better behavior in all cases.
Yup, thanks Luciano for the patch and Peff for a (n always) good
review.