From: Quentin Young Date: Sun, 7 May 2017 04:42:07 +0000 (+0000) Subject: lib: abort if fd >= FD_SETSIZE and using select X-Git-Tag: reindent-master-before~196^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=6a5fb771a93bf5d2ae80e4ae954b827ac04371e3;p=matthieu%2Ffrr.git lib: abort if fd >= FD_SETSIZE and using select Signed-off-by: Quentin Young --- diff --git a/lib/thread.c b/lib/thread.c index d4ed5d1a08..74d498baf8 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -786,6 +786,12 @@ funcname_thread_add_read_write (int dir, struct thread_master *m, #if defined (HAVE_POLL) thread = generic_thread_add(m, func, arg, fd, dir, debugargpass); #else + if (fd >= FD_SETSIZE) + { + zlog_err ("File descriptor %d is >= FD_SETSIZE (%d). Please recompile" + "with --enable-poll=yes", fd, FD_SETSIZE); + assert (fd < FD_SETSIZE && !"fd >= FD_SETSIZE"); + } thread_fd_set *fdset = NULL; if (dir == THREAD_READ) fdset = &m->handler.readfd;