summaryrefslogtreecommitdiffstats
path: root/bin/sh/parser.c
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2009-11-22 18:23:30 +0000
committerjilles <jilles@FreeBSD.org>2009-11-22 18:23:30 +0000
commit760264169e554e3e2ae8312f8f192d1ad95c7854 (patch)
treed42fd7d5720d96daa7589c733afd3cc29c10f330 /bin/sh/parser.c
parentba91da3aff4fb68aa0ec546f7eeb21855b267fc7 (diff)
downloadFreeBSD-src-760264169e554e3e2ae8312f8f192d1ad95c7854.zip
FreeBSD-src-760264169e554e3e2ae8312f8f192d1ad95c7854.tar.gz
Fix various things about SIGINT handling:
* exception handlers are now run with interrupts disabled, which avoids many race conditions * fix some cases where SIGINT only aborts one command and continues the script, in particular if a SIGINT causes an EINTR error which trumped the interrupt. Example: sh -c 'echo < /some/fifo; echo This should not be printed' The fifo should not have writers. When pressing ctrl+c to abort the open, the shell used to continue with the next command. Example: sh -c '/bin/echo < /some/fifo; echo This should not be printed' Similar. Note, however, that this particular case did not and does not work in interactive mode with job control enabled.
Diffstat (limited to 'bin/sh/parser.c')
-rw-r--r--bin/sh/parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index 5218dc0..855becc 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -1312,6 +1312,7 @@ parsebackq: {
int saveprompt;
const int bq_startlinno = plinno;
+ str = NULL;
if (setjmp(jmploc.loc)) {
if (str)
ckfree(str);
@@ -1323,7 +1324,6 @@ parsebackq: {
longjmp(handler->loc, 1);
}
INTOFF;
- str = NULL;
savelen = out - stackblock();
if (savelen > 0) {
str = ckmalloc(savelen);
OpenPOWER on IntegriCloud