From 6d334b40f46fec7bb54e3bd68c1e0ceb8eb33de2 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 17 Jan 2016 14:03:31 -0500 Subject: block_*(): Use non-exiting error() --- diff --git a/src/block.sh b/src/block.sh index feab865..ad94bde 100644 --- a/src/block.sh +++ b/src/block.sh @@ -48,12 +48,14 @@ block_mount() rand dir="$(get_vardata_dir 'mount')/block-$(printf '%010d' ${rand_x})" if ! mkdir "${dir}"; then - error 2 "$(get_msg 'block_mkdir_fail')" "${dir}" + error "$(get_msg 'block_mkdir_fail')" "${dir}" + return 1 fi if ! mount "${dev}" "${dir}"; then + error "$(get_msg 'block_mount_fail')" "${dev}" rmdir "${dir}" - error 2 "$(get_msg 'block_mount_fail')" "${dev}" + return 1 fi printf '%s' "${dir}" @@ -78,11 +80,13 @@ block_umount() done if ${timed_out}; then - error 2 "$(get_msg 'block_umount_fail')" "${dir}" + error "$(get_msg 'block_umount_fail')" "${dir}" + return 1 fi if ! rmdir "${dir}"; then - error 2 "$(get_msg 'block_rmdir_fail')" "${dir}" + error "$(get_msg 'block_rmdir_fail')" "${dir}" + return 1 fi return 0 -- cgit v0.9.1