[arch-projects] [devtools] [PATCH] Pass the correct exit argument to cleanup

Joel Teichroeb joel at teichroeb.net
Fri May 16 14:55:12 EDT 2014


cleanup was recently changed to exit 0 if no arguments are passed.
Since trap_exit calls cleanup with no arguments, it always exits 0,
regardless of the original parameter to exit.

This patch passes the parameter from exit to cleanup.
---
   lib/common.sh | 3 ++-
   1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/common.sh b/lib/common.sh
index b885080..55dc9ad 100644
--- a/lib/common.sh
+++ b/lib/common.sh
@@ -79,8 +79,9 @@ trap_abort() {
   }

   trap_exit() {
+	STATUS=$?
   	trap - EXIT INT QUIT TERM HUP
-	cleanup
+	cleanup $STATUS
   }

   die() {
-- 
1.9.2



More information about the arch-projects mailing list