diff options
author | P. J. McDermott <pj@pehjota.net> | 2016-01-17 14:03:31 (EST) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2016-01-17 14:03:31 (EST) |
commit | 6d334b40f46fec7bb54e3bd68c1e0ceb8eb33de2 (patch) | |
tree | 2f6602b408c0d11dc9c7c8c872df2602f41d5e86 | |
parent | c40a12488b8e9e929d8b2aa2ad52904867f8c278 (diff) |
block_*(): Use non-exiting error()
-rw-r--r-- | src/block.sh | 12 |
1 files changed, 8 insertions, 4 deletions
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 |