bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EPIPE in standard utils ([issue41])


From: Paul Eggert
Subject: Re: EPIPE in standard utils ([issue41])
Date: 03 Mar 2003 21:42:26 -0800
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.3

[Trimming CC: list since this seems to be a utilities issue.]

> Perhaps I'm missing it -- but this version of sed doesn't appear to
> ignore SIGPIPE.

It doesn't, but (as you mentioned later) most likely the parent
process ignored SIGPIPE and sed inherited that.  In that case the sed
behavior is expected.  However, normally SIGPIPE is not ignored, so a
typical program will die instantly with no opportunity to write a
message to stderr.

> you get this signal (SIGPIPE) when you declare (by not ignoring
> SIGPIPE) that you don't think your program will ever write to a
> readerless pipe

No, that's typically not the intent, because almost any program can be
set up to write to a readerless pipe.  In such case it is expected
that the program will be killed.

I think it'll be an uphill battle to convince programmers to revamp
all their utilities to treat EPIPE specially, just to avoid
diagnostics in the rare cases where the parent ignores SIGPIPE.  The
current tradition is longstanding, and undoubtedly some scripts depend
on it.  The advantages of changing the tradition seem small, and the
cost of conversion nontrivial.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]