summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-08-10 13:29:56 +0000
committerJim Meyering <jim@meyering.net>2003-08-10 13:29:56 +0000
commit5701c74f6d20e6a69aa75eb03b82a3992b111df3 (patch)
tree1ebc9df57253822f6474b8dfbec8ebb8977648a8 /lib
parent8bdd034bd407d264c92464eb0ada4d64e464598e (diff)
downloadcoreutils-5701c74f6d20e6a69aa75eb03b82a3992b111df3.tar.xz
(utimens): Revert most of last change.
Test HAVE_WORKING_UTIMES instead of HAVE_UTIMES.
Diffstat (limited to 'lib')
-rw-r--r--lib/utimens.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/utimens.c b/lib/utimens.c
index a8c147efc..9f1a0e116 100644
--- a/lib/utimens.c
+++ b/lib/utimens.c
@@ -47,17 +47,17 @@ utimens (char const *file, struct timespec const timespec[2])
/* There's currently no interface to set file timestamps with
nanosecond resolution, so do the best we can, discarding any
fractional part of the timestamp. */
-#if HAVE_UTIME
- struct utimbuf utimbuf;
- utimbuf.actime = timespec[0].tv_sec;
- utimbuf.modtime = timespec[1].tv_sec;
- return utime (file, &utimbuf);
-#else
+#if HAVE_WORKING_UTIMES
struct timeval timeval[2];
timeval[0].tv_sec = timespec[0].tv_sec;
timeval[0].tv_usec = timespec[0].tv_nsec / 1000;
timeval[1].tv_sec = timespec[1].tv_sec;
timeval[1].tv_usec = timespec[1].tv_nsec / 1000;
return utimes (file, timeval);
+#else
+ struct utimbuf utimbuf;
+ utimbuf.actime = timespec[0].tv_sec;
+ utimbuf.modtime = timespec[1].tv_sec;
+ return utime (file, &utimbuf);
#endif
}