]> git.ipfire.org Git - thirdparty/coreutils.git/commit
timeout: round timeouts up
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 5 Apr 2025 07:58:22 +0000 (00:58 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 5 Apr 2025 07:58:58 +0000 (00:58 -0700)
commita3b862ece2aa04d5c0b5e93fec8e66e45b9b3560
treeca54b588084c0a893dc68d42fefe751b4d0d537a
parent43873a660de20d854d88c04183826c3f8d2466b3
timeout: round timeouts up

This handles timeouts like 16777216.000000001 correctly;
formerly the subsecond part of that timeout was ignored.
* bootstrap.conf (gnulib_modules): Add fenv-rounding, signbit.
* src/local.mk (src_timeout_LDADD): Append $(FENV_ROUNDING_LIBM).
* src/timeout.c: Include fenv.h, math.h.
Don’t include xstrtod.h, as xstrtod’s checking now gets in the way.
(parse_duration): Round up when calling cl_strtod.
Check for -1e-1000.  Don’t double-round 1e-9.
* tests/timeout/timeout-parameters.sh: Test for -0.1,
-1e-1000, 1e-1000.
bootstrap.conf
src/local.mk
src/timeout.c
tests/timeout/timeout-parameters.sh