From owner-freebsd-current Tue Apr 7 06:01:44 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA20235 for freebsd-current-outgoing; Tue, 7 Apr 1998 06:01:44 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from cons.org (knight.cons.org [194.233.237.86]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA20224 for ; Tue, 7 Apr 1998 06:01:31 -0700 (PDT) (envelope-from cracauer@cons.org) Received: (from cracauer@localhost) by cons.org (8.8.5/8.7.3) id PAA07388; Tue, 7 Apr 1998 15:00:45 +0200 (CEST) Message-ID: <19980407150043.03815@cons.org> Date: Tue, 7 Apr 1998 15:00:43 +0200 From: Martin Cracauer To: Bruce Evans , cracauer@cons.org Cc: freebsd-current@FreeBSD.ORG Subject: Re: make/SIGINT (Re: cvs commit: src/bin/sh jobs.c) Mail-Followup-To: Bruce Evans , cracauer@cons.org, freebsd-current@FreeBSD.ORG References: <199803131513.CAA27634@godzilla.zeta.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=fdj2RfSjLxBAspz7 X-Mailer: Mutt 0.89i In-Reply-To: <199803131513.CAA27634@godzilla.zeta.org.au>; from Bruce Evans on Sat, Mar 14, 1998 at 02:13:11AM +1100 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=us-ascii In <199803131513.CAA27634@godzilla.zeta.org.au>, Bruce Evans wrote: > SIGQUIT handling is still buggy. For the simple Makefile: > --- > foo: > sleep 1000 > --- > killing make with SIGQUIT gives the following behaviours: > > 1. make: exits with status 3 (SIGQUIT) (per the above change). > 2. make -j4: hangs (broken). > 3: gmake: exits with status 1. > 3: gmake -j4: exits with status 1. > > POSIX.2 only requires a nonzero exit status for SIGQUIT. We've just > fixed the handling of SIGINT, SIGTERM and SIGHUP. The appended diff fixes the hangs for `make -j4`->SIGQUIT by exiting with SIGINT exit status. I don't consider it that ugly to report exit on SIGINT to the calling process when the actual signal was SIGQUIT. Alternativly, we could limit coredumpsize = 0 and then exit with SIGQUIT. Martin -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Martin Cracauer http://www.cons.org/cracauer cracauer@wavehh.hanse.de (batched, preferred for large mails) Tel.: (daytime) +4940 41478712 Fax.: (daytime) +4940 41478715 Tel.: (private) +4940 5221829 Fax.: (private) +4940 5228536 Paper: (private) Waldstrasse 200, 22846 Norderstedt, Germany --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=diff diff -c -r /usr/src/usr.bin/make/compat.c make.work/compat.c *** /usr/src/usr.bin/make/compat.c Thu Mar 26 15:41:48 1998 --- make.work/compat.c Tue Apr 7 14:44:31 1998 *************** *** 125,131 **** } } ! exit (signo); } /*- --- 125,134 ---- } } ! if (signo == SIGQUIT) ! exit(signo); ! (void) signal(signo, SIG_DFL); ! (void) kill(getpid(), signo); } /*- diff -c -r /usr/src/usr.bin/make/job.c make.work/job.c *** /usr/src/usr.bin/make/job.c Thu Mar 26 15:41:53 1998 --- make.work/job.c Tue Apr 7 14:53:37 1998 *************** *** 395,401 **** * Leave gracefully if SIGQUIT, rather than core dumping. */ if (signo == SIGQUIT) { ! Finish(0); } /* --- 395,401 ---- * Leave gracefully if SIGQUIT, rather than core dumping. */ if (signo == SIGQUIT) { ! signo = SIGINT; } /* *************** *** 2904,2910 **** } } (void) eunlink(tfile); - exit(signo); } /* --- 2904,2909 ---- --fdj2RfSjLxBAspz7-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message