]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: use more portable timeout presence check
authorPádraig Brady <P@draigBrady.com>
Tue, 14 Jan 2025 22:45:55 +0000 (22:45 +0000)
committerPádraig Brady <P@draigBrady.com>
Wed, 15 Jan 2025 12:07:52 +0000 (12:07 +0000)
* init.cfg: timeout(1) on FreeBSD doesn't support --version
(or --help with success status), so use syntax compatible
with both FreeBSD and GNU.

init.cfg

index 0aaba4ee2bdb3ad149d9157a2e297629758e1687..ae158c7a3bb5bf12d939f863babcb771fc7b4961 100644 (file)
--- a/init.cfg
+++ b/init.cfg
@@ -570,7 +570,7 @@ seek_data_capable_()
   # We saw FreeBSD 9.1 take 35s to return from SEEK_DATA for a 1TiB empty file.
   # Note lseek() is uninterruptible on FreeBSD 9.1, but it does eventually
   # return, and the timeout will ensure a failure return from the process.
-  timeout --version >/dev/null && TIMEOUT_='timeout 10'
+  timeout 1 true >/dev/null && TIMEOUT_='timeout 10'
 
   $TIMEOUT_ $PYTHON_ "$abs_srcdir"/tests/seek-data-capable "$@"
 }
@@ -660,7 +660,7 @@ mkfifo_or_skip_()
 
 trap_sigpipe_or_skip_()
 {
-  timeout --version >/dev/null ||
+  timeout 1 true >/dev/null ||
     skip_ 'trapping SIGPIPE cannot be safely checked'
 
   (trap '' PIPE && timeout 10 yes |:) 2>&1 | grep 'Broken pipe' >/dev/null ||