summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/poll.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/poll.c b/src/poll.c
index 79b847a..2a2ef34 100644
--- a/src/poll.c
+++ b/src/poll.c
@@ -269,6 +269,9 @@ void fastd_poll_handle(void) {
if (timeout < 0 || timeout > maintenance_timeout)
timeout = maintenance_timeout;
+ if (VECTOR_LEN(ctx.pollfds) != 2 + ctx.n_socks + VECTOR_LEN(ctx.peers))
+ exit_bug("fd count mismatch");
+
int ret = poll(VECTOR_DATA(ctx.pollfds), VECTOR_LEN(ctx.pollfds), timeout);
if (ret < 0) {
if (errno == EINTR)
@@ -305,6 +308,9 @@ void fastd_poll_handle(void) {
fastd_receive(peer->sock);
}
}
+
+ if (VECTOR_LEN(ctx.pollfds) != 2 + ctx.n_socks + VECTOR_LEN(ctx.peers))
+ exit_bug("fd count mismatch");
}
#endif