]> git.ipfire.org Git - thirdparty/coreutils.git/commit
timeout: don’t sleep less than requested
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 7 Apr 2025 07:30:14 +0000 (00:30 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 7 Apr 2025 07:59:27 +0000 (00:59 -0700)
commitcb7c210d30c5a6a4a879bda96d61926d77f16d96
treefb0068d59bc42430e34977c179d8aecbff31da17
parent0311d45d5b921c49c9eb5778f1e326b40683fb20
timeout: don’t sleep less than requested

Also, change sleep and tail to not sleep less than requested.
* bootstrap.conf (gnulib_modules): Add dtimespec-bound.
* gl/lib/dtimespec-bound.c, gl/lib/dtimespec-bound.h:
* gl/modules/dtimespec-bound: New files.
* src/sleep.c, src/tail.c, src/timeout.c: Include dtimespec-bound.h.
* src/sleep.c, src/tail.c: Don’t include xstrtod.h.
* src/sleep.c (apply_suffix, main):
* src/tail.c (parse_options):
* src/timeout.c (apply_time_suffix):
Don’t sleep less than the true number of seconds.
* src/timeout.c: Don’t include ctype.h.
(is_negative): Remove; no longer needed.
(parse_duration): Use a slightly looser bound on the timeout, one
that doesn’t need -lm on GNU/Linux.  Clear errno before calling
cl_strtod.
NEWS
bootstrap.conf
gl/lib/dtimespec-bound.c [new file with mode: 0644]
gl/lib/dtimespec-bound.h [new file with mode: 0644]
gl/modules/dtimespec-bound [new file with mode: 0644]
src/sleep.c
src/tail.c
src/timeout.c