Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!think!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!rutgers!att!cbnewsd!jrstu From: jrstu@cbnewsd.ATT.COM (james.stuhlmacher) Newsgroups: comp.os.minix Subject: make(1) keeps on compiling when interrupt is pressed Message-ID: <12429@cbnewsd.ATT.COM> Date: 3 Jan 90 03:39:36 GMT Reply-To: jrstu@cbnewsd.ATT.COM (james.stuhlmacher,ih,) Organization: AT&T Bell Laboratories Lines: 76 This is a reposting. About a month ago I posted an article stating that make(1) does not quit completely when you press the interrupt key. It just stops the one compile and starts the next. I blamed this on system(3) that was ignoring the SIGINT signal. Terrence Holm wrote me a letter explaining that system(3) should ignore signals in case you start an interactive shell via it. He also said that make(1) should look at the exit status of system(3) to determine whether it should completely stop or not. This made sense so I looked at the code for make(1) and it DOES look at the exit status. Before I could proceed, Bruce Evans wrote a letter to me saying its all sh(1)s fault because it does not return the interrupt status of its interrupted child. (System(3) calls "sh -c command".) Thus sh(1) was returning 0 when it should have been returning the number of the signal that aborted its child. System(3) simply passes on the exit status of sh(1) to the program that called system(3). Bruce also sent me the patch below to fix the bug. After looking through the code, I think this is the correct fix. This patch has been redone for v1.5.0. #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'sh3.cdif' <<'END_OF_FILE' X*** osh3.c Tue Jan 2 10:39:45 1990 X--- nsh3.c Tue Jan 2 11:06:00 1990 X*************** X*** 509,516 **** X if (canintr) X intr = 0; X } X! else X! onintr(); X return(rv); X } X X--- 509,519 ---- X if (canintr) X intr = 0; X } X! else { X! if (exstat == 0) X! exstat = rv; X! onintr(); X! } X return(rv); X } X END_OF_FILE if test 343 -ne `wc -c <'sh3.cdif'`; then echo shar: \"'sh3.cdif'\" unpacked with wrong size! fi # end of 'sh3.cdif' fi echo shar: End of shell archive. exit 0 Jim Stuhlmacher j.stuhlmacher@ATT.com ..!att!ihlpb!jims