[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: utimens and non-standardized futimesat [was: coreutils-6.11-1 in rel
From: |
Bruno Haible |
Subject: |
Re: utimens and non-standardized futimesat [was: coreutils-6.11-1 in release-2 area] |
Date: |
Thu, 29 May 2008 13:04:45 +0200 |
User-agent: |
KMail/1.5.4 |
Eric Blake wrote:
> Tested on cygwin 1.7.0, where futimens and utimensat exist, and on cygwin
> 1.5.25, where those and futimesat are all missing. OK to apply? This
> means that coreutils can now support nanosecond resolution on new enough
> kernels for things like touch and cp -p.
Two nits (I'm really only nitpicking):
- You introduce two #ifs that have to be the same condition:
#if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES
...
#if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES
It is preferrable, for maintenance (I speak from experience with
vasnprintf.c...)
to have this #if only at one place. In this case, I would simply add a
brace group to the contents and reindent:
#if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES
{
struct timeval timeval[2];
...
}
#endif
- Is it conceivable that a platform has
HAVE_FUTIMENS && (HAVE_FUTIMESAT || HAVE_WORKING_UTIMES)
? In this case, gcc will warn about dead/unreached code. I would change the
#if HAVE_FUTIMENS
return futimens (fd, timespec);
#endif
to
#if HAVE_FUTIMENS
return futimens (fd, timespec);
#else
... rest of the function ...
#endif
Bruno