summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-06-09 23:17:49 +0200
committerDave Reisner <dreisner@archlinux.org>2012-07-15 16:29:08 +0200
commitc4fcc20e9446ed0715681c0d664feb7cb3af2bbb (patch)
treee8838c6a2e4a0394481fcd7ec39860a5149c7a26
parent59ae6346ba32ecbf59dcef2feddb1bd81527465d (diff)
downloadmkinitcpio-c4fcc20e9446ed0715681c0d664feb7cb3af2bbb.tar.gz
mkinitcpio-c4fcc20e9446ed0715681c0d664feb7cb3af2bbb.tar.xz
use last exit status as default arg for cleanup
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rwxr-xr-xmkinitcpio4
1 files changed, 3 insertions, 1 deletions
diff --git a/mkinitcpio b/mkinitcpio
index 43a89df..0834dc0 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -55,6 +55,8 @@ EOF
}
cleanup() {
+ local err=${1:-$?}
+
if [[ $workdir ]]; then
# when PRESET is set, we're in the main loop, not a worker process
if (( SAVELIST )) && [[ -z $PRESET ]]; then
@@ -64,7 +66,7 @@ cleanup() {
fi
fi
- exit ${1:0}
+ exit $err
}
resolve_kernver() {