From peter@spinner.DIALix.COM  Sun Nov 10 04:32:01 1996
Received: from spinner.DIALix.COM (peter@spinner.DIALix.COM [192.203.228.67])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id EAA05241
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 10 Nov 1996 04:31:58 -0800 (PST)
Received: (from peter@localhost)
          by spinner.DIALix.COM (8.8.2/8.8.2) id UAA13146;
          Sun, 10 Nov 1996 20:31:54 +0800 (WST)
Message-Id: <199611101231.UAA13146@spinner.DIALix.COM>
Date: Sun, 10 Nov 1996 20:31:54 +0800 (WST)
From: Peter Wemm <peter@spinner.DIALix.COM>
Reply-To: peter@spinner.DIALix.COM
To: FreeBSD-gnats-submit@freebsd.org
Subject: 'make fetch' broken in recent sh/make changes
X-Send-Pr-Version: 3.2

>Number:         1990
>Category:       bin
>Synopsis:       'make fetch' broken in recent sh/make changes
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 10 04:40:01 PST 1996
>Closed-Date:    Tue Nov 12 10:39:43 PST 1996
>Last-Modified:  Tue Nov 12 10:42:57 PST 1996
>Originator:     Peter Wemm
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
>Environment:

'make world' a few hours ago, not yet rebooted.  kernel is:
FreeBSD spinner.DIALix.COM 3.0-CURRENT FreeBSD 3.0-CURRENT #156: Wed Nov  6 00:44:55 WST 1996     peter@spinner.DIALix.COM:/home/src/sys/compile/SPINNER  i386

>Description:

The 'fetch' stage of ports does not abort on ^C any more, causing the fetch
stage to continue on running in the background after a deliberate interrupt
attempt.

>How-To-Repeat:

peter@spinner[8:13pm]~ports/net/cvsup-235> make fetch
>Fix:
	
I don't know, but I am suspicious of the recent change to /bin/sh
where the handling of SIGINT was changed with the 'sh -c' command to
help things like system() in crontab etc.

As you can see, the 'sh -ec (..)' continued on running after the SIGINT
without aborting the for loop.  The currently running 'fetch' got the signal
and died, the sh -ec for loop started another in the background.

>Release-Note:
>Audit-Trail:

From: Peter Wemm <peter@spinner.DIALix.COM>
To: freebsd-gnats-submit@freefall.freebsd.org
Cc:  Subject: bin/1990
Date: Sun, 10 Nov 1996 20:51:50 +0800 (WST)

 A possible fix for the make/sh bug with SIGINT:
 
 Index: eval.c
 ===================================================================
 RCS file: /home/ncvs/src/bin/sh/eval.c,v
 retrieving revision 1.7
 diff -u -r1.7 eval.c
 --- eval.c	1996/10/22 03:02:07	1.7
 +++ eval.c	1996/11/10 12:39:58
 @@ -854,7 +854,7 @@
  parent:	/* parent process gets here (if we forked) */
  	if (mode == 0) {	/* argument to fork */
  		INTOFF;
 -		if (minusc) {
 +		if (minusc && !eflag) {
  			struct sigaction iact, qact, oiact, oqact;
  
  			(void)sigaction(SIGINT, (struct sigaction *)NULL, &oiact);
 
 This makes 'sh -ec' consider SIGINT as an 'error' worth aborting, and
 stops the long 'make fetch' command on ^C as it should.
 
 The 'if (minusc) {..' code was recently added (rev 1.7 of eval.c), it
 seems to be the cause of the problems.
 
 Incidently, I could find no other shells that ignored SIGINT while doing
 a 'sh -c' command..  Is this code really legitimate??  It looks like a
 gratuitous incompatability with "other" systems...
State-Changed-From-To: open->closed 
State-Changed-By: peter 
State-Changed-When: Tue Nov 12 10:39:43 PST 1996 
State-Changed-Why:  
This was fixed by backing out rev 1.7 of bin/sh/eval.c, which reopens 
PR#1206. Sigh.  The problem here was a side effect of the fix for that PR. 
>Unformatted:
 >> cvsup-13.5.tar.gz doesn't seem to exist on this system.
 >> Attempting to fetch from ftp://freefall.freebsd.org/pub/CVSup/.
 ^Cfetch: Interrupted by signal 2
 >> Attempting to fetch from ftp://ftp.freebsd.org/pub/FreeBSD/distfiles//.
 peter@spinner[8:13pm]~ports/net/cvsup-236> ps
 Receiving cvsup-13.5.tar.gz (168573 bytes)
   PID  TT  STAT      TIME COMMAND
  1744  p8  Is     0:00.48 -tcsh (tcsh)
  1745  p9  Is     0:00.54 -tcsh (tcsh)
 [..]
  1996  pu  Ss     0:02.71 -tcsh (tcsh)
 13022  pu  S      0:00.04 /bin/sh -ec (cd /usr/ports/distfiles/;  for file in c
 13028  pu  S      0:00.14 /usr/bin/fetch ftp://ftp.freebsd.org/pub/FreeBSD/dist
 13029  pu  R+     0:00.03 ps
 [..]
   236  v3  Is+    0:00.53 -tcsh (tcsh)
 Receiving cvsup-13.5.tar.gz (168573 bytes): 100%
 168573 bytes transfered in 58.2 seconds  (2.83 K/s)
 
 peter@spinner[8:15pm]~ports/net/cvsup-237> 
 
