* src/timeout.c (parse_duration): Clamp infinitesimal values to 1ns.
* tests/timeout/timeout-large-parameters.sh: Add a test case.
* NEWS: Mention the bug fix.
Fixes https://bugs.gnu.org/77535
like with dangling symlinks on cygwin.
[bug introduced in coreutils-9.6]
+ timeout would fail to timeout commands with infinitesimal timeouts.
+ For example `timeout 1e-5000 sleep inf` would never timeout.
+ [bug introduced with timeout in coreutils-7.0]
+
'who -m' now outputs entries for remote logins. Previously login
entries prefixed with the service (like "sshd") were not matched.
[bug introduced in coreutils-9.4]
usage (EXIT_CANCELED);
}
+ /* Clamp underflow to 1ns, as 0 disables the timeout. */
+ if (duration == 0 && errno == ERANGE)
+ duration = 1e-9;
+
return duration;
}
timeout $LDBL_MAX sleep 0 || fail=1
returns_ 125 timeout -- -$LDBL_MAX sleep 0 || fail=1
+# Ensure underflow times out immediately
+returns_ 124 timeout 1e-5000 sleep 10 || fail=1
+
Exit $fail