chiark / gitweb /
poll: Introduce and use BEFOREPOLL_WANT_FDS
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 20 Sep 2014 16:52:14 +0000 (17:52 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 29 Sep 2014 15:01:05 +0000 (16:01 +0100)
commitcf423c1b3196e98b0e2abaf56165baf65b6975d9
tree8d874eed3d52ad722b941d9da41be12ebbf3870e
parentb322d6cbd4fa140338d2f7af47ada689401a14e3
poll: Introduce and use BEFOREPOLL_WANT_FDS

This helper macro provides a convenient implementation of the
beforepoll_fn interface for *nfds_io.  Use it everywhere.

This produces one bugfix: log_from_fd_beforepoll would fail to set
*nfds_io if it was finished,

This also arranges for many beforepoll callbacks to actually fail
properly with ERANGE if there is not enough space.  Previously they
would blithely write the next fd entry or two.  In practice the
provided fd array never runs out in the current code, so in these
cases we are just fixing latent bugs.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
log.c
process.c
secnet.h
site.c
slip.c
tun.c
udp.c