chiark / gitweb /
poll: Introduce and use BEFOREPOLL_WANT_FDS
[secnet.git] / udp.c
diff --git a/udp.c b/udp.c
index 03025c7e438a3e2cd9f201617d63c28f91a14018..fcce186613b4de0424f2e94aab500a446b641f7b 100644 (file)
--- a/udp.c
+++ b/udp.c
@@ -75,11 +75,7 @@ static int udp_beforepoll(void *state, struct pollfd *fds, int *nfds_io,
 {
     int i;
     struct udp *st=state;
-    if (*nfds_io<st->n_socks) {
-       *nfds_io=st->n_socks;
-       return ERANGE;
-    }
-    *nfds_io=st->n_socks;
+    BEFOREPOLL_WANT_FDS(st->n_socks);
     for (i=0; i<st->n_socks; i++) {
        fds[i].fd=st->socks[i].fd;
        fds[i].events=POLLIN;