[COMMITTED] elf: preserve exit code in tests

Sam James sam@gentoo.org
Sat Aug 8 00:05:41 GMT 2026


Use $fail when we set it rather than just '1' (we already checked
that it is non-zero) to make logs more meaningful.

(Also, use $rc when we already checked it svalue.)
---
Pushed as obvious.

 elf/tst-dl-debug-exclude.sh    | 2 +-
 elf/tst-dl-debug-protect.sh    | 2 +-
 elf/tst-tls-debug-recursive.sh | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/elf/tst-dl-debug-exclude.sh b/elf/tst-dl-debug-exclude.sh
index 9837ffcea8..6c54695091 100644
--- a/elf/tst-dl-debug-exclude.sh
+++ b/elf/tst-dl-debug-exclude.sh
@@ -79,7 +79,7 @@ if [ $fail -ne 0 ]; then
   echo "Test FAILED"
   cat "${debug_output}".*
   rm -f "${debug_output}".*
-  exit 1
+  exit $fail
 fi
 
 echo "Test PASSED"
diff --git a/elf/tst-dl-debug-protect.sh b/elf/tst-dl-debug-protect.sh
index 7a9ed1175d..b7c3d7100a 100644
--- a/elf/tst-dl-debug-protect.sh
+++ b/elf/tst-dl-debug-protect.sh
@@ -43,7 +43,7 @@ rc=$?
 if test $rc -eq 77; then
   echo "Test is not supported"
   rm -f "${output}".*
-  exit 77
+  exit $rc
 fi
 
 output=$(ls "${output}".*)
diff --git a/elf/tst-tls-debug-recursive.sh b/elf/tst-tls-debug-recursive.sh
index 083e716f72..c978944a71 100755
--- a/elf/tst-tls-debug-recursive.sh
+++ b/elf/tst-tls-debug-recursive.sh
@@ -74,7 +74,7 @@ if [ $fail -ne 0 ]; then
   echo "Test FAILED"
   cat "${debug_output}"
   rm -f "${debug_output}"
-  exit 1
+  exit $fail
 fi
 
 echo "Test PASSED"
-- 
2.55.0



More information about the Libc-alpha mailing list