summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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