Re: SIGPIPE problems
Re: SIGPIPE problems
- Subject: Re: SIGPIPE problems
- From: Vincent Lubet <email@hidden>
- Date: Fri, 15 Mar 2002 12:14:50 -0800
On Friday, March 15, 2002, at 10:53 AM, Chilton Webb wrote:
I was under the impression that you could ignore sigpipes and use the
returned error (epipe) from a write to perform some action (like stop
writing to that socket)
My code thus far does this...
signal(SIGPIPE,SIG_IGN);
/*then, later...*/
nwritten = write(fd, Zero, nleft);
Now, when the socket at fd breaks, I get a SIGPIPE error. I was under
the impression that the call to signal would force that error to be
ignored. I'm not making any other calls to signal (afaik), so what
gives?
This is preventing a signal to be delivered to your process -- the
default action for SIGPIPE is to kill your process -- and instead you
just need to deal with EPIPE.
By the way, you should also deal with error EINTR from any system call.
Vincent
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.