From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5114 invoked from network); 19 Jul 2009 20:14:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 19 Jul 2009 20:14:52 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 81293 invoked from network); 19 Jul 2009 20:14:43 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 19 Jul 2009 20:14:43 -0000 Received: (qmail 25850 invoked by alias); 19 Jul 2009 20:14:37 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 27169 Received: (qmail 25831 invoked from network); 19 Jul 2009 20:14:36 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 19 Jul 2009 20:14:36 -0000 Received: from vms173009pub.verizon.net (vms173009pub.verizon.net [206.46.173.9]) by bifrost.dotsrc.org (Postfix) with ESMTP id 181018027106 for ; Sun, 19 Jul 2009 22:14:33 +0200 (CEST) Received: from torch.brasslantern.com ([96.238.220.32]) by vms173009.mailsrvcs.net (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPA id <0KN100IFZPJUZZT0@vms173009.mailsrvcs.net> for zsh-workers@sunsite.dk; Sun, 19 Jul 2009 15:14:21 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id n6JKEHUE004046 for ; Sun, 19 Jul 2009 13:14:18 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id n6JKEHNk004045 for zsh-workers@sunsite.dk; Sun, 19 Jul 2009 13:14:17 -0700 From: Bart Schaefer Message-id: <090719131417.ZM4044@torch.brasslantern.com> Date: Sun, 19 Jul 2009 13:14:17 -0700 In-reply-to: <090719121557.ZM3304@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: zsh 4.3.10 terminates with SIGINT when one types Ctrl-G in emacs under Mac OS X" (Jul 19, 12:15pm) References: <090712193623.ZM14823@torch.brasslantern.com> <200907131839.n6DIdO6Z003291@pws-pc.ntlworld.com> <20090716162419.GA26179@prunille.vinc17.org> <090717222936.ZM8648@torch.brasslantern.com> <20090718101602.GA5392@xvii> <090718111615.ZM10393@torch.brasslantern.com> <090719110339.ZM3126@torch.brasslantern.com> <090719121557.ZM3304@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@sunsite.dk Subject: Re: zsh 4.3.10 terminates with SIGINT when one types Ctrl-G in emacs under Mac OS X MIME-version: 1.0 Content-type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.94.2/9589/Sun Jul 19 05:14:56 2009 on bifrost X-Virus-Status: Clean On Jul 19, 12:15pm, Bart Schaefer wrote: } } The only way I can see to fix this is to re-introduce the wait_cmd second } argument to signal_suspend(). PWS? Any thoughts? Here's a patch in case there's agreement this is the right approach. Apply *instead of* zsh-workers/27165. Line numbers may be wonky in the jobs.c patch. Index: Src/jobs.c =================================================================== --- Src/jobs.c 17 Apr 2009 18:57:22 -0000 1.27 +++ Src/jobs.c 19 Jul 2009 19:19:10 -0000 @@ -1178,7 +1191,7 @@ kill(pid, SIGCONT); last_signal = -1; - signal_suspend(SIGCHLD); + signal_suspend(SIGCHLD, wait_cmd); if (last_signal != SIGCHLD && wait_cmd && last_signal >= 0 && (sigtrapped[last_signal] & ZSIG_TRAPPED)) { /* wait command interrupted, but no error: return */ @@ -1217,7 +1230,7 @@ while (!errflag && jn->stat && !(jn->stat & STAT_DONE) && !(interact && (jn->stat & STAT_STOPPED))) { - signal_suspend(SIGCHLD); + signal_suspend(SIGCHLD, wait_cmd); if (last_signal != SIGCHLD && wait_cmd && last_signal >= 0 && (sigtrapped[last_signal] & ZSIG_TRAPPED)) { Index: Src/signals.c =================================================================== --- Src/signals.c 28 Feb 2009 07:13:37 -0000 1.22 +++ Src/signals.c 19 Jul 2009 20:07:04 -0000 @@ -342,29 +342,32 @@ /**/ int -signal_suspend(UNUSED(int sig)) +signal_suspend(UNUSED(int sig), int wait_cmd) { int ret; - -#ifdef POSIX_SIGNALS + +#if defined(POSIX_SIGNALS) || defined(BSD_SIGNALS) sigset_t set; -#ifdef BROKEN_POSIX_SIGSUSPEND +# if defined(POSIX_SIGNALS) && defined(BROKEN_POSIX_SIGSUSPEND) sigset_t oset; -#endif /* BROKEN_POSIX_SIGSUSPEND */ +# endif sigemptyset(&set); -#ifdef BROKEN_POSIX_SIGSUSPEND + if (!(wait_cmd || isset(TRAPSASYNC) || + (sigtrapped[SIGINT] & ~ZSIG_IGNORED))) + sigaddset(&set, SIGINT); +#endif /* POSIX_SIGNALS || BSD_SIGNALS */ + +#ifdef POSIX_SIGNALS +# ifdef BROKEN_POSIX_SIGSUSPEND sigprocmask(SIG_SETMASK, &set, &oset); pause(); sigprocmask(SIG_SETMASK, &oset, NULL); -#else /* not BROKEN_POSIX_SIGSUSPEND */ +# else /* not BROKEN_POSIX_SIGSUSPEND */ ret = sigsuspend(&set); -#endif /* BROKEN_POSIX_SIGSUSPEND */ +# endif /* BROKEN_POSIX_SIGSUSPEND */ #else /* not POSIX_SIGNALS */ # ifdef BSD_SIGNALS - sigset_t set; - - sigemptyset(&set); ret = sigpause(set); # else # ifdef SYSV_SIGNALS