diff options
| author | Paul Eggert | 2018-09-10 21:16:03 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-09-10 21:22:54 -0700 |
| commit | fc389d3a836c11893ac5c5894915e9b8b4868799 (patch) | |
| tree | f62c09355c5e498403f4df5feea99a3d4f7709ff /lib/timespec-sub.c | |
| parent | 0407733ef3d4e8e133e91917097dbc9bcc688b47 (diff) | |
| download | emacs-fc389d3a836c11893ac5c5894915e9b8b4868799.tar.gz emacs-fc389d3a836c11893ac5c5894915e9b8b4868799.zip | |
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/timespec-sub.c')
| -rw-r--r-- | lib/timespec-sub.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/timespec-sub.c b/lib/timespec-sub.c index 398a6a5de47..9eac36e51ac 100644 --- a/lib/timespec-sub.c +++ b/lib/timespec-sub.c | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | /* Return the difference between two timespec values A and B. On | 20 | /* Return the difference between two timespec values A and B. On |
| 21 | overflow, return an extremal value. This assumes 0 <= tv_nsec < | 21 | overflow, return an extremal value. This assumes 0 <= tv_nsec < |
| 22 | TIMESPEC_RESOLUTION. */ | 22 | TIMESPEC_HZ. */ |
| 23 | 23 | ||
| 24 | #include <config.h> | 24 | #include <config.h> |
| 25 | #include "timespec.h" | 25 | #include "timespec.h" |
| @@ -38,7 +38,7 @@ timespec_sub (struct timespec a, struct timespec b) | |||
| 38 | 38 | ||
| 39 | if (ns < 0) | 39 | if (ns < 0) |
| 40 | { | 40 | { |
| 41 | rns = ns + TIMESPEC_RESOLUTION; | 41 | rns = ns + TIMESPEC_HZ; |
| 42 | if (bs < tmax) | 42 | if (bs < tmax) |
| 43 | bs++; | 43 | bs++; |
| 44 | else if (- TYPE_SIGNED (time_t) < rs) | 44 | else if (- TYPE_SIGNED (time_t) < rs) |
| @@ -63,7 +63,7 @@ timespec_sub (struct timespec a, struct timespec b) | |||
| 63 | else | 63 | else |
| 64 | { | 64 | { |
| 65 | rs = tmax; | 65 | rs = tmax; |
| 66 | rns = TIMESPEC_RESOLUTION - 1; | 66 | rns = TIMESPEC_HZ - 1; |
| 67 | } | 67 | } |
| 68 | } | 68 | } |
| 69 | 69 | ||