From b18172598f83bbdc0dc8dd99ed7f587972fc8b32 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 17 Jan 2016 15:58:08 -0500 Subject: session_begin(), session_end(): Use non-exiting error() --- (limited to 'src/session.sh') 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 -- cgit v0.9.1