summaryrefslogtreecommitdiff
path: root/lib/stat-time.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-09-10 21:16:03 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2018-09-10 21:22:54 -0700
commitfc389d3a836c11893ac5c5894915e9b8b4868799 (patch)
treef62c09355c5e498403f4df5feea99a3d4f7709ff /lib/stat-time.h
parent0407733ef3d4e8e133e91917097dbc9bcc688b47 (diff)
downloademacs-fc389d3a836c11893ac5c5894915e9b8b4868799.tar.gz
Update from Gnulib
This incorporates: 2018-09-10 timespec: fix resolution confusion 2018-09-09 mktime: simplify in prep for glibc merge 2018-09-07 intprops: minor clarification of code 2018-09-06 stddef: Override max_align_t on NetBSD 8.0/x86 2018-09-06 fcntl: Fix F_DUPFD_CLOEXEC behaviour on Haiku 2018-09-06 strtoll, strtoull: Rely on limits-h module 2018-09-06 limits-h: Provide numerical limits macros 2018-09-06 fcntl: Don't access nonexistent optional argument 2018-09-02 mktime: fix unlikely race+overflow bug 2018-08-31 mktime, timegm: simplify glibc time64_t 2018-08-31 mktime, timegm: simplify merge to glibc * build-aux/config.guess, build-aux/config.sub: * lib/dtotimespec.c, lib/fcntl.c, lib/intprops.h: * lib/limits.in.h, lib/mktime-internal.h, lib/mktime.c: * lib/stat-time.h, lib/strtol.c, lib/timegm.c: * lib/timespec-add.c, lib/timespec-sub.c, lib/timespec.h: * lib/utimens.c, m4/limits-h.m4, m4/stddef_h.m4: Copy from Gnulib.
Diffstat (limited to 'lib/stat-time.h')
-rw-r--r--lib/stat-time.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/stat-time.h b/lib/stat-time.h
index 8e787bd3b2d..69ebe85df1d 100644
--- a/lib/stat-time.h
+++ b/lib/stat-time.h
@@ -213,7 +213,7 @@ stat_time_normalize (int result, struct stat *st _GL_UNUSED)
#if defined __sun && defined STAT_TIMESPEC
if (result == 0)
{
- long int timespec_resolution = 1000000000;
+ long int timespec_hz = 1000000000;
short int const ts_off[] = { offsetof (struct stat, st_atim),
offsetof (struct stat, st_mtim),
offsetof (struct stat, st_ctim) };
@@ -221,11 +221,11 @@ stat_time_normalize (int result, struct stat *st _GL_UNUSED)
for (i = 0; i < sizeof ts_off / sizeof *ts_off; i++)
{
struct timespec *ts = (struct timespec *) ((char *) st + ts_off[i]);
- long int q = ts->tv_nsec / timespec_resolution;
- long int r = ts->tv_nsec % timespec_resolution;
+ long int q = ts->tv_nsec / timespec_hz;
+ long int r = ts->tv_nsec % timespec_hz;
if (r < 0)
{
- r += timespec_resolution;
+ r += timespec_hz;
q--;
}
ts->tv_nsec = r;