Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh Fix interrupt problam from David Laight



details:   https://anonhg.NetBSD.org/src/rev/2530e686886d
branches:  trunk
changeset: 538619:2530e686886d
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Oct 23 13:25:24 2002 +0000

description:
Fix interrupt problam from David Laight

$ /fred # non existant command
$ ^C # stops working

He says:
    Ok the extra INTOFF is the one in exverror().
    In almost all cases this doesn't matter because the longjmp()s
    all end up in main() and the FORCEINTON call sorts it out
    for the next command.
    (There are a significant number of INTON/OFF mismatches through
    the error paths...)

    In any case the above failure can be 'fixed' by changing 2 (I think
    they are both needed) INTON calls to FORCEINTON within evalcommand.
    The following patch seems to work:

We should really look in the code and fix the INTON->INTOFF pairs.

diffstat:

 bin/sh/eval.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 9b437e2603cc -r 2530e686886d bin/sh/eval.c
--- a/bin/sh/eval.c     Wed Oct 23 13:24:28 2002 +0000
+++ b/bin/sh/eval.c     Wed Oct 23 13:25:24 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: eval.c,v 1.65 2002/09/28 01:25:01 christos Exp $       */
+/*     $NetBSD: eval.c,v 1.66 2002/10/23 13:25:24 christos Exp $       */
 
 /*-
  * Copyright (c) 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)eval.c     8.9 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: eval.c,v 1.65 2002/09/28 01:25:01 christos Exp $");
+__RCSID("$NetBSD: eval.c,v 1.66 2002/10/23 13:25:24 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -805,7 +805,7 @@
 #endif
                        if (forkshell(jp, cmd, mode) != 0)
                                goto parent;    /* at end of routine */
-                       INTON;
+                       FORCEINTON;
 #ifdef DO_SHAREDVFORK
                }
 #endif
@@ -953,7 +953,7 @@
                close(pip[1]);
                backcmd->jp = jp;
        }
-       INTON;
+       FORCEINTON;
 
 out:
        if (lastarg)



Home | Main Index | Thread Index | Old Index