pa_poll(): Simplify detection of invalid fds in select() emulation mode
authorDaniel Mack <zonque@gmail.com>
Wed, 13 Apr 2011 17:51:49 +0000 (19:51 +0200)
committerColin Guthrie <colin@mageia.org>
Mon, 18 Apr 2011 08:31:51 +0000 (10:31 +0200)
commita44092d39de9a0abb4f3e3eaede219efe67e3964
tree2cb640b2cfaf75650fae7dac0fcc1939f9a0c114
parenta2581e6688c3fdcde4734f52a6b5fbc489f782b3
pa_poll(): Simplify detection of invalid fds in select() emulation mode

For systems which have a fcntl() implementation, we can simplify the
code which determines whether a file selector is valid in pa_poll().

The old code, which is harder to read and more expensive, stays around
for all platforms we need to emulate poll() for using select(), and
which don't provide fcntl(). IOW, for Windows.

On Mac OS X, however, the detection for bad fds via more select() calls
doesn't work, resulting in hung main loops, so the patch fixes a real
bug there.
src/pulsecore/poll.c