]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: tests: DRY a recent change
authorPádraig Brady <P@draigBrady.com>
Thu, 19 Feb 2026 19:42:14 +0000 (19:42 +0000)
committerPádraig Brady <P@draigBrady.com>
Thu, 19 Feb 2026 19:42:14 +0000 (19:42 +0000)
* tests/pwd/pwd-long.sh: Adjust so complicated command is not repeated.

tests/pwd/pwd-long.sh

index 2a010f2f2dacdad462dfaa9e31518e8605fa02f8..26e1822e7a18b81a850c05e6a52a85174a526822 100755 (executable)
@@ -28,13 +28,10 @@ ARGV_0=$0
 export ARGV_0
 
 # Disable the getcwd syscall if possible, so more of our code is exercised.
-if strace -f -o /dev/null -e 'getcwd' -e fault=all:error=ENOSYS true; then
-  no_sys_getcwd() {
-    strace -f -o /dev/null -e 'getcwd' -e fault=all:error=ENOSYS "$@"
-  }
-else
-  no_sys_getcwd() { "$@"; }
-fi
+no_sys_getcwd() {
+  strace -f -o /dev/null -e 'getcwd' -e fault=all:error=ENOSYS "$@"
+}
+no_sys_getcwd true || no_sys_getcwd() { "$@"; }
 
 # Don't use CuTmpdir here, since File::Temp's use of rmtree can't
 # remove the deep tree we create.