From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17392 invoked by alias); 31 Jul 2010 21:54:15 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15219 Received: (qmail 24020 invoked from network); 31 Jul 2010 21:54:06 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at ntlworld.com designates 81.103.221.49 as permitted sender) Date: Sat, 31 Jul 2010 22:53:45 +0100 From: Peter Stephenson To: zsh-users@zsh.org Subject: Re: Option PRINT_EXIT_VALUE doesn't always work as expected Message-ID: <20100731225345.2cad292e@pws-pc> In-Reply-To: <20100730130204.GC8757@ypig.lip.ens-lyon.fr> References: <20100730130204.GC8757@ypig.lip.ens-lyon.fr> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.1 cv=DhNl2YeytwJssBBGe49HJX82LNDFEEVkpVB34RXKaPo= c=1 sm=0 a=rNnWHmR4J4oA:10 a=DogomfpGjd0A:10 a=kj9zAlcOel0A:10 a=YR4_K0clAAAA:8 a=NLZqzBF-AAAA:8 a=cmrWlzvQTNUsjTZ548QA:9 a=-yZ-BdTDGLKRjhV27bwA:7 a=wLx3hvx60GXHL0MQw9FBxLcVpgQA:4 a=CjuIK1q_8ugA:10 a=8EUp7cGwtfYA:10 a=_dQi-Dcv4p4A:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 On Fri, 30 Jul 2010 15:02:04 +0200 Vincent Lefevre wrote: > Also, if tst is a script that does "exit 141", I get as expected: > > ypig% ./tst | head -n 1 > zsh: exit 141 ./tst | > zsh: done head -n 1 > ypig% echo $pipestatus > 141 0 > > but if tst does "kill -PIPE $$", I get: > > ypig% ./tst | head -n 1 > ypig% echo $pipestatus > 141 0 The fact that the signal number + 128 is added to get the status isn't currently taken account at that point. It should presumably be transparent. Index: Src/jobs.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/jobs.c,v retrieving revision 1.76 diff -p -u -r1.76 jobs.c --- Src/jobs.c 31 Jul 2010 21:06:12 -0000 1.76 +++ Src/jobs.c 31 Jul 2010 21:47:54 -0000 @@ -873,6 +873,10 @@ printjob(Job jn, int lng, int synch) sflag = 1; if (job == thisjob && sig == SIGINT) doputnl = 1; + if (isset(PRINTEXITVALUE) && isset(SHINSTDIN)) { + sflag = 1; + skip_print = 0; + } } else if (WIFSTOPPED(pn->status)) { sig = WSTOPSIG(pn->status); if ((int)strlen(sigmsg(sig)) > len) -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/