[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnash-commit] /srv/bzr/gnash/rtmp r9771: use pselect() and ppoll()
From: |
strk |
Subject: |
Re: [Gnash-commit] /srv/bzr/gnash/rtmp r9771: use pselect() and ppoll() instewad of select() or poll() to handle signals cleanly. |
Date: |
Sat, 22 Nov 2008 23:25:50 +0100 |
On Sat, Nov 22, 2008 at 09:31:39AM -0700, address@hidden wrote:
> ------------------------------------------------------------
> revno: 9771
> committer: address@hidden
> branch nick: rtmp
> timestamp: Sat 2008-11-22 09:31:39 -0700
> message:
> use pselect() and ppoll() instewad of select() or poll() to handle signals
> cleanly.
> +#ifdef HAVE_PSELECT
> + struct timespec tval;
> + sigset_t emptyset, blockset;
> + sigemptyset(&blockset); /* Block SIGINT */
> + sigaddset(&blockset, SIGINT);
> + sigaddset(&blockset, SIGPIPE);
> + sigprocmask(SIG_BLOCK, &blockset, NULL);
...
> + if (block) {
> + ret = pselect(fd+1, &fdset, NULL, NULL, NULL, &emptyset);
> + } else {
> + ret = pselect(fd+1, &fdset, NULL, NULL, &tval, &emptyset);
> + }
Did you mean to pass &blockset instead of &emptyset to that pselect ?
It fixes the SIGPIPE for me if I do so, and gives a nice:
ERROR: Couldn't write 128 bytes to fd #5: Broken pipe
Ok, also doen's let me kill with ^C, but that's because blockset also
blocks SIGINT....
--strk;