From 5393e50727c29bd29c4461019e2b426f701a88c5 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 07 Oct 2014 15:02:33 -0400 Subject: error(): Die by signal Calling error() within a subshell will now kill the whole shell process. More importantly, session_end() will now be called if we've started a session. --- (limited to 'lib') diff --git a/lib/output.sh b/lib/output.sh index ffe982d..877c7fc 100644 --- a/lib/output.sh +++ b/lib/output.sh @@ -30,7 +30,10 @@ error() printf '%s: Error: ' "${0##*/}" >&2 printf "${fmt}\n" "${@}" >&2 - exit ${status} + # In a subshell, this will have no effect, so the shell's exit status + # will be 128+SIGINT. Meh. + exit_status=${status} + kill -s INT ${$} } warn() -- cgit v0.9.1