From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21134 invoked from network); 3 Sep 1997 06:22:25 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 3 Sep 1997 06:22:25 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id CAA01801; Wed, 3 Sep 1997 02:17:39 -0400 (EDT) Resent-Date: Wed, 3 Sep 1997 02:17:39 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199709030617.CAA02204@hzoli.home> Subject: SIGPIPE handling To: zsh-workers@math.gatech.edu (Zsh hacking and development) Date: Wed, 3 Sep 1997 02:17:44 -0400 (EDT) X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"cgNXc3.0.4S.24G3q"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3476 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Zsh and ksh simply dies when they receive an untrapped SIGPIPE signal, while bash and pdksh catch the signal, and exit with exit status 141. If you call zsh or bash from a shell script, you'll not notice the difference, since the shell reports exit status 141 for processes killed by signal 13 = SIGPIPE, but the status returned by the wait() system call is different, and for zsh and ksh, WIFSIGNALLED will be true, while for bash and pdksh WIFEXITED will be true. Reading the standard (http://www.rdg.opengroup.org/unix/online.html) it seems to me that the zsh and ksh behavior is the correct one, since that's the default signal behavior, and the standard does not mentions that SIGPIPE should be handled specially (Chet, if you are still reading this list, I'd like to hear your opinion). Unoftunately the install-info perl script in Debian relies on the bash SIGPIPE behavior, hence fails when /bin/sh is zsh or ksh. The patch below for the Debian install-info program fixes the problem. It still allows the bash behavior. Someone reported this problem long ago, but at that time I did not use Debian, and I had no idea what can cause this. Even now using Debian it took me a while to solve this puzzle. Zoltan --- /usr/sbin/install-info.ORIG Sun Jan 26 01:15:02 1997 +++ /usr/sbin/install-info Wed Sep 3 02:03:24 1997 @@ -345,7 +345,7 @@ } sub checkpipe { - return if !$pipeit || !$? || $?==0x8D00; + return if !$pipeit || !$? || $?==0x8D00 || $?==0xD; die "$name: read $filename: $?\n"; }