bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

utimes() vs. close()


From: Eric Blake
Subject: utimes() vs. close()
Date: Wed, 19 Oct 2005 14:35:58 +0000

A bug report was filed on cygwin due to the algorithm change
in cp -p.  In 5.3.0 the syscall sequence was close(dest_desc),
utimes(dest).  In 5.90, the sequence now uses gnulib
futimens(dest_desc, dest), close().  But on cygwin (which does
not yet have futimes), futimens makes the syscall utimes(dest),
setting the timestamps, then the close() again sets the
timestamps.  I was unable to determine from POSIX if this
behavior is permissable (close changing the timestamps of
an open file descriptor, even when the underlying file had its
timestamps changed externally), in which case there is a
rather severe regression in coreutils (cp -p no longer preserves
timestamps, because it calls utimes() too soon), or whether
POSIX forbids close() from changing timestamps if utimes()
was called on the underlying file, in which case it is a bug in
cygwin.

Any thoughts?

--
Eric Blake




reply via email to

[Prev in Thread] Current Thread [Next in Thread]