Source-Changes-HG archive

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

[src/netbsd-1-4]: src/bin/sh pull up rev 1.32 from trunk (requested by mycroft):



details:   https://anonhg.NetBSD.org/src/rev/1e1386fcab70
branches:  netbsd-1-4
changeset: 469543:1e1386fcab70
user:      cgd <cgd%NetBSD.org@localhost>
date:      Sat Oct 09 21:27:31 1999 +0000

description:
pull up rev 1.32 from trunk (requested by mycroft):
  Allow the tty interrupt character (e.g. ^C) to interrupt loops run
  in an interactive shell again.

diffstat:

 bin/sh/jobs.c |  29 ++++++++++++++++-------------
 1 files changed, 16 insertions(+), 13 deletions(-)

diffs (52 lines):

diff -r 1f332c8b3c7b -r 1e1386fcab70 bin/sh/jobs.c
--- a/bin/sh/jobs.c     Sat Oct 09 21:24:23 1999 +0000
+++ b/bin/sh/jobs.c     Sat Oct 09 21:27:31 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: jobs.c,v 1.29.2.1 1999/04/19 04:07:53 mycroft Exp $    */
+/*     $NetBSD: jobs.c,v 1.29.2.2 1999/10/09 21:27:31 cgd Exp $        */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)jobs.c     8.5 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: jobs.c,v 1.29.2.1 1999/04/19 04:07:53 mycroft Exp $");
+__RCSID("$NetBSD: jobs.c,v 1.29.2.2 1999/10/09 21:27:31 cgd Exp $");
 #endif
 #endif /* not lint */
 
@@ -730,19 +730,22 @@
 #endif
        else
                st = WTERMSIG(status) + 128;
+#if JOBS
+       if (jp->jobctl) {
+               /*
+                * This is truly gross.
+                * If we're doing job control, then we did a TIOCSPGRP which
+                * caused us (the shell) to no longer be in the controlling
+                * session -- so we wouldn't have seen any ^C/SIGINT.  So, we
+                * intuit from the subprocess exit status whether a SIGINT
+                * occured, and if so interrupt ourselves.  Yuck.  - mycroft
+                */
+               if (WIFSIGNALED(status) && WTERMSIG(status) == SIGINT)
+                       raise(SIGINT);
+       }
+#endif
        if (! JOBS || jp->state == JOBDONE)
                freejob(jp);
-#if 0
-       /*
-        * XXXX
-        * Why was this here?  It causes us to lose SIGINTs unless the current
-        * command happens to also catch the SIGINT and exit with the right
-        * status.  I don't see how that can possibly be correct.  -- mycroft
-        */
-       CLEAR_PENDING_INT;
-       if (WIFSIGNALED(status) && WTERMSIG(status) == SIGINT)
-               raise(SIGINT);
-#endif
        INTON;
        return st;
 }



Home | Main Index | Thread Index | Old Index