summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mkarchroot.in10
1 files changed, 8 insertions, 2 deletions
diff --git a/mkarchroot.in b/mkarchroot.in
index 6dd8003..7473a01 100644
--- a/mkarchroot.in
+++ b/mkarchroot.in
@@ -162,9 +162,12 @@ copy_hostconf () {
sed -r "s|^#?\\s*CacheDir.+|CacheDir = $(echo -n ${cache_dirs[@]})|g" -i ${working_dir}/etc/pacman.conf
}
+trap_unmount_err () {
+ error "Error unmounting"
+}
+
trap_chroot_umount () {
- trap 'trap_abort' INT QUIT TERM HUP
- trap 'trap_exit' EXIT
+ trap 'trap_unmount_err' INT QUIT TERM HUP EXIT
for cache_dir in ${cache_dirs[@]}; do
umount "${working_dir}/${cache_dir}"
@@ -183,6 +186,9 @@ trap_chroot_umount () {
umount "${working_dir}/dev"
umount "${working_dir}/run"
fi
+
+ trap 'trap_abort' INT QUIT TERM HUP
+ trap 'trap_exit' EXIT
}
chroot_lock () {