Date: Tue, 7 Apr 1998 15:00:43 +0200 From: Martin Cracauer <cracauer@cons.org> To: Bruce Evans <bde@zeta.org.au>, cracauer@cons.org Cc: freebsd-current@FreeBSD.ORG Subject: Re: make/SIGINT (Re: cvs commit: src/bin/sh jobs.c) Message-ID: <19980407150043.03815@cons.org> In-Reply-To: <199803131513.CAA27634@godzilla.zeta.org.au>; from Bruce Evans on Sat, Mar 14, 1998 at 02:13:11AM %2B1100 References: <199803131513.CAA27634@godzilla.zeta.org.au>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <cracauer@cons.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980407150043.03815>