[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-dev] Re: SIGPIPE handling
From: |
John Gilmore |
Subject: |
[Gnash-dev] Re: SIGPIPE handling |
Date: |
Thu, 14 Oct 2010 17:50:39 -0700 |
> - bytesSent = ::send(_socket, buf, toWrite, MSG_NOSIGNAL);
> + // I'd like to get no SIGPIPE here, as we wouldn't
> + // know how to handle. Instead, for broken pipe I'd
> + // prefer being notified with a return of -1.
> + // Is that possible, in a standard way ?
> + // MSG_NOSIGNAL was reported as being non-standard flag..
> + bytesSent = ::send(_socket, buf, toWrite, 0);
The usual way is to do:
signal(SIGPIPE, SIG_IGN);
which says to ignore that signal rather than deliver it. This is a
stateful setting, which remains set until the process ends or you
change it. This is a portable construct (though most other uses
of signal() are not portable).
The return value can be used to re-establish the former SIGPIPE
handler if you want; or it can just be thrown away if you're doing
this in mainline (rather than library) code and you know you don't
ever want to restore the default or former setting.
John
- [Gnash-dev] Re: SIGPIPE handling,
John Gilmore <=