summaryrefslogtreecommitdiff
path: root/lib/utimensat.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-09-10 18:42:25 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2018-09-10 18:43:46 -0700
commitb021c53fd4dc009a144db2312d195dd925f0e6fd (patch)
tree4c5a792eecbcf3adfc6fb237bee27451b3b857fe /lib/utimensat.c
parent8b55a44258e3a217dec66acb8398e7d00059de4b (diff)
downloadgnulib-b021c53fd4dc009a144db2312d195dd925f0e6fd.tar.gz
timespec: fix resolution confusion
In normal usage, clock resolution is given in seconds, but the code was mistakenly using inverse seconds and calling it “resolution”. Fix this, partly by renaming two identifiers. The old names will be kept for a bit, to ease transition. * lib/timespec.h (TIMESPEC_HZ, LOG10_TIMESPEC_HZ): New constants, replacing TIMESPEC_RESOLUTION and LOG10_TIMESPEC_RESOLUTION, which are now obsolescent. All uses changed.
Diffstat (limited to 'lib/utimensat.c')
-rw-r--r--lib/utimensat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/utimensat.c b/lib/utimensat.c
index 72ac1b4adb..6d4144cb4a 100644
--- a/lib/utimensat.c
+++ b/lib/utimensat.c
@@ -94,10 +94,10 @@ rpl_utimensat (int fd, char const *file, struct timespec const times[2],
else if (times
&& ((times[0].tv_nsec != UTIME_NOW
&& ! (0 <= times[0].tv_nsec
- && times[0].tv_nsec < TIMESPEC_RESOLUTION))
+ && times[0].tv_nsec < TIMESPEC_HZ))
|| (times[1].tv_nsec != UTIME_NOW
&& ! (0 <= times[1].tv_nsec
- && times[1].tv_nsec < TIMESPEC_RESOLUTION))))
+ && times[1].tv_nsec < TIMESPEC_HZ))))
{
errno = EINVAL;
return -1;