summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/session.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/session.sh b/src/session.sh
index 6453fae..0728080 100644
--- a/src/session.sh
+++ b/src/session.sh
@@ -43,13 +43,16 @@ session_begin()
[ -d "${session_root}/prokit" ] || mkdir "${session_root}/prokit"
if [ -f "${session_root}/prokit/installing" ] && ! ${installing}; then
- error 2 "$(get_msg 'install_running')"
+ error "$(get_msg 'install_running')"
+ return 1
fi
session_set_sigs
if ! mutex_timedlock "${session_root}/prokit/sessions.lock" 5; then
- error 2 "$(get_msg 'cant_lock_sessions')"
+ error "$(get_msg 'cant_lock_sessions')"
+ trap - ${session_sigs}
+ return 1
fi
# Check for a sessions pool.
@@ -95,7 +98,9 @@ session_end()
if ! mutex_is_unlockable "${session_root}/prokit/sessions.lock"; then
if ! mutex_timedlock "${session_root}/prokit/sessions.lock" 5
then
- error 2 "$(get_msg 'cant_lock_sessions')"
+ error "$(get_msg 'cant_lock_sessions')"
+ trap - ${session_sigs}
+ return 1
fi
fi