From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25505 invoked by alias); 29 Sep 2014 15:29:25 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33280 Received: (qmail 23638 invoked from network); 29 Sep 2014 15:29:25 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) 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.2 From: Bart Schaefer Message-id: <140929082915.ZM6214@torch.brasslantern.com> Date: Mon, 29 Sep 2014 08:29:15 -0700 In-reply-to: <20140929094551.5d0256f6@pwslap01u.europe.root.pri> Comments: In reply to Peter Stephenson "Re: SIGPIPE (Re: ZSH history not saved anymore)" (Sep 29, 9:45am) References: <87mw9qdp7s.fsf@thinkpad-t440p.tsdh.org> <20140924200710.2f764272@pws-pc.ntlworld.com> <8738bg2n1v.fsf@thinkpad-t440p.tsdh.org> <140926000448.ZM30835@torch.brasslantern.com> <878ul6lrw9.fsf@thinkpad-t440p.tsdh.org> <87y4t66td0.fsf@thinkpad-t440p.tsdh.org> <871tqxqyil.fsf@thinkpad-t440p.tsdh.org> <140927105301.ZM31550@torch.brasslantern.com> <20140927214035.7af22023@pws-pc.ntlworld.com> <140927165554.ZM32155@torch.brasslantern.com> <140928110438.ZM27132@torch.brasslantern.com> <20140928191850.61c28815@pws-pc.ntlworld.com> <140928131627.ZM4749@torch.brasslantern.com> <20140929094551.5d0256f6@pwslap01u.europe.root.pri> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: SIGPIPE (Re: ZSH history not saved anymore) MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Sep 29, 9:45am, Peter Stephenson wrote: } } > Why did TRAPPIPE() receive a SIGPIPE? } } I think we're looking at this in execcmd() or similar chunks. } } /* It's a builtin */ } if (forked) } closem(FDT_INTERNAL); } lastval = execbuiltin(args, (Builtin) hn); } fflush(stdout); } if (save[1] == -2) { } if (ferror(stdout)) { } zwarn("write error: %e", errno); } clearerr(stdout); } } } } else } clearerr(stdout); } } so it doesn't necessarily mean there's a signal, just that there's a } broken pipe. The zwarn() explains why the output appears more than once, but there definitely are two calls to TRAPPIPE, so I think that does mean that there was a signal 2 of the 3 times? } Maybe the fflush() is enough to trigger setting errno } again if it failed to write the first time? The fflush is probably enough to trigger a second SIGPIPE if the shell didn't exit on the first one.