Re: handling borken pipes
- From: "Joshua Swanson" <ielond.kharas@xxxxxxxxx>
- Date: Fri, 25 Apr 2008 12:18:20 -0700
Ok, thanks guys, I'll use comp.unix.programmer in future.
"ppi" <vodoom@xxxxxxxxx> wrote in message
news:c7329d7a-82b2-46c5-b154-be65f5f8fb0a@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
What's the best way to handle this? I'm tempted just to throw in an
ignore
signal handle (signal(SIGPIPE, SIG_IGN) of the top of my head) and pay no
attention to broken pipes, but I don't know enough to be sure this is
always
correct. For instance, I don't get why the signal is fatal by default, as
it
seems relatively minor.
Ignoring SIGPIPE is ok.
SIGPIPE was originally sent to processes writing to a "real" pipe i.e.
2 cooperative processes that communicate through a named/unnamed pipe.
Terminating the process, when receiving the SIGPIPE, was the correct
behavior: reader dies unexpectedly, it is nice to have the writer to
terminate by default (it was later on added for the BSD socket API)
Anyway, since ignoring SIGPIPE results in errno set to it when write
fails that's probably what you want.
and santosh is right: comp.unix.programmer is better place for that
kind of question ;-)
-- paulo
.
- Follow-Ups:
- Re: handling borken pipes
- From: CBFalconer
- Re: handling borken pipes
- References:
- handling borken pipes
- From: Joshua Swanson
- Re: handling borken pipes
- From: ppi
- handling borken pipes
- Prev by Date: Re: handling borken pipes
- Next by Date: Re: handling borken pipes
- Previous by thread: Re: handling borken pipes
- Next by thread: Re: handling borken pipes
- Index(es):
Relevant Pages
|