summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2016-01-17 10:29:43 (EST)
committer P. J. McDermott <pj@pehjota.net>2016-01-17 10:29:43 (EST)
commit69b9e4d24a0efa73405bbe42f7e06b567bb1f60e (patch)
tree8dd7097eac16fd236aa54def85f1c55745cfcd51
parent9346b9c6eb26b71dd9a7f93440007e07d0f89298 (diff)
*_vardata(): Use non-exiting error()
-rw-r--r--src/vardata.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/vardata.sh b/src/vardata.sh
index 05c9cff..6a7e749 100644
--- a/src/vardata.sh
+++ b/src/vardata.sh
@@ -36,12 +36,14 @@ init_vardata()
rand
vardatadir="${tmpdir}/${PACKAGE}-$(printf '%010d' ${rand_x})"
if ! mkdir "${vardatadir}"; then
- error 2 "$(get_msg 'temp_mkdir_fail')" "${vardatadir}"
+ error "$(get_msg 'temp_mkdir_fail')" "${vardatadir}"
+ return 1
fi
for dir in ${VARDATA_DIRS}; do
if ! mkdir "${vardatadir}/${dir}"; then
- error 2 "$(get_msg 'temp_mkdir_fail')" \
+ error "$(get_msg 'temp_mkdir_fail')" \
"${vardatadir}/${dir}"
+ return 1
fi
done
@@ -54,12 +56,14 @@ fini_vardata()
for dir in ${VARDATA_DIRS}; do
if ! rmdir "${vardatadir}/${dir}"; then
- error 2 "$(get_msg 'temp_rmdir_fail')" \
+ error "$(get_msg 'temp_rmdir_fail')" \
"${vardatadir}/${dir}"
+ return 1
fi
done
if ! rmdir "${vardatadir}"; then
- error 2 "$(get_msg 'temp_rmdir_fail')" "${vardatadir}"
+ error "$(get_msg 'temp_rmdir_fail')" "${vardatadir}"
+ return 1
fi
return 0