From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23095 invoked from network); 17 Feb 2006 14:28:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 17 Feb 2006 14:28:30 -0000 Received: (qmail 41460 invoked from network); 17 Feb 2006 14:28:24 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Feb 2006 14:28:24 -0000 Received: (qmail 340 invoked by alias); 17 Feb 2006 14:28:21 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22276 Received: (qmail 327 invoked from network); 17 Feb 2006 14:28:20 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 17 Feb 2006 14:28:20 -0000 Received: (qmail 41070 invoked from network); 17 Feb 2006 14:28:20 -0000 Received: from vinc17.net8.nerim.net (HELO prunille.vinc17.org) (62.212.121.106) by a.mx.sunsite.dk with SMTP; 17 Feb 2006 14:28:18 -0000 Received: by prunille.vinc17.org (Postfix, from userid 501) id 4D5216715B6; Fri, 17 Feb 2006 15:28:16 +0100 (CET) Date: Fri, 17 Feb 2006 15:28:16 +0100 From: Vincent Lefevre To: zsh-workers@sunsite.dk Subject: [4.2/4.3] Bug with wait and trapped signals Message-ID: <20060217142816.GE1708@prunille.vinc17.org> Mail-Followup-To: zsh-workers@sunsite.dk MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Mailer-Info: http://www.vinc17.org/mutt/ User-Agent: Mutt/1.5.11-vl-20060130 zsh (all versions?) does not interrupt a "wait" when it receives a signal for which a trap has been set. For instance, consider the following script: #!/usr/bin/env zsh echo "PID = $$" sleep 60 & trap 'echo term; exit 0' TERM wait When I send SIGTERM to the shell process, zsh does nothing, waiting for the child to terminate before executing the trap. POSIX says: 2.11 Signals and Error Handling [...] When the shell is waiting, by means of the wait utility, for asynchronous commands to complete, the reception of a signal for which a trap has been set shall cause the wait utility to return immediately with an exit status >128, immediately after which the trap associated with that signal shall be taken. http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_11 -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / SPACES project at LORIA