tech-userlevel archive

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

Re: the zen of SIGPIPE

> We have a small number of executables in /usr/bin that write an error
> message to standard error when they receive SIGPIPE on writing to
> standard output.

I don't think we do, actually.

We have a small number of utilities that report EPIPE when writing to
something, usually standard output.  That most programs don't report
such errors is because they die on SIGPIPE before they ever see the
EPIPE.  (We have an even smaller number of programs, like the xargs you
cite, that report _other_ programs' SIGPIPE deaths.)

I'm not sure how important I consider this difference.  But I am fairly
sure that confusing two things (SIGPIPE and EPIPE) produced by the same
underlying cause (a write on something pipelike with no readers) is not
likely to help anyone.

As for what you seem to be arguing for, that being to either let
SIGPIPE kill these processes or make them special-case EPIPE for a
silent exit...this strikes me as the kind of foolish consistency that
Pope rightly called a hobgoblin of little minds.  Complete consistency
across all parts of the system is neither achievable nor desirable, and
I am unconvinced that this particular bit of consistency is worth
putting nontrivial effort into.  I think a more worthwhile thing to
campaign against would be noise messages in success cases in general.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML      
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Home | Main Index | Thread Index | Old Index