zsh-workers
 help / color / mirror / code / Atom feed
From: Zoltan Hidvegi <hzoli@frontiernet.net>
To: zsh-workers@math.gatech.edu (Zsh hacking and development)
Subject: SIGPIPE handling
Date: Wed, 3 Sep 1997 02:17:44 -0400 (EDT)	[thread overview]
Message-ID: <199709030617.CAA02204@hzoli.home> (raw)

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";
 }
 


             reply	other threads:[~1997-09-03  6:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-03  6:17 Zoltan Hidvegi [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-05-18 19:00 Zoltan Hidvegi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199709030617.CAA02204@hzoli.home \
    --to=hzoli@frontiernet.net \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).