chiark / gitweb /
poll: Introduce and use BEFOREPOLL_WANT_FDS
[secnet.git] / udp.c
diff --git a/udp.c b/udp.c
index 8ae5671bd64a38a16914997ffe035f65e0b4d26f..98da30d6f66f391ac8944a4e2a835dacf257572e 100644 (file)
--- a/udp.c
+++ b/udp.c
@@ -87,11 +87,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;