/* Set file access and modification times.
- Copyright (C) 2003-2009 Free Software Foundation, Inc.
+ Copyright (C) 2003-2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
}
# endif /* HAVE_UTIMENSAT */
# if HAVE_FUTIMENS
- {
- result = futimens (fd, ts);
+ if (0 <= fd)
+ {
+ result = futimens (fd, ts);
# ifdef __linux__
- /* Work around the same bug as above. */
- if (0 < result)
- errno = ENOSYS;
+ /* Work around the same bug as above. */
+ if (0 < result)
+ errno = ENOSYS;
# endif /* __linux__ */
- if (result == 0 || errno != ENOSYS)
- {
- utimensat_works_really = 1;
- return result;
- }
- }
+ if (result == 0 || errno != ENOSYS)
+ {
+ utimensat_works_really = 1;
+ return result;
+ }
+ }
# endif /* HAVE_FUTIMENS */
}
utimensat_works_really = -1;
{
#if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES
struct timeval timeval[2];
- struct timeval const *t;
+ struct timeval *t;
if (ts)
{
timeval[0].tv_sec = ts[0].tv_sec;
#if HAVE_LUTIMES && !HAVE_UTIMENSAT
{
struct timeval timeval[2];
- struct timeval const *t;
+ struct timeval *t;
int result;
if (ts)
{