[COMMITTED] elf: preserve exit code in tests

Sam James <[email protected]>
Newsgroups gmane.comp.lib.glibc.alpha
Message-ID <e053ceaa665d1dbd6e775b93ab98131c5d34ccd6.1786147540.git.sam@gentoo.org>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.