aboutsummaryrefslogtreecommitdiff
path: root/fdm.c
diff options
context:
space:
mode:
Diffstat (limited to 'fdm.c')
-rw-r--r--fdm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fdm.c b/fdm.c
index e26d394c..c7af68d0 100644
--- a/fdm.c
+++ b/fdm.c
@@ -142,6 +142,12 @@ fdm_del_no_close(struct fdm *fdm, int fd)
bool
fdm_poll(struct fdm *fdm)
{
+ assert(!fdm->is_polling && "nested calls to fdm_poll() not allowed");
+ if (fdm->is_polling) {
+ LOG_ERR("nested calls to fdm_poll() not allowed");
+ return false;
+ }
+
struct epoll_event events[tll_length(fdm->fds)];
int ret = epoll_wait(fdm->epoll_fd, events, tll_length(fdm->fds), -1);
if (ret == -1) {