summaryrefslogtreecommitdiff
path: root/lib/thread.c
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2017-05-07 19:49:26 -0400
committerGitHub <noreply@github.com>2017-05-07 19:49:26 -0400
commitaf95eb875578407ebc75c4afe2874a1a5ffe4b49 (patch)
treec1115e07cbe84cafea78b0d9033454ad51093884 /lib/thread.c
parentba2d7123d57d0e5fe4fc0246dd44acc0d99822a9 (diff)
parent6a5fb771a93bf5d2ae80e4ae954b827ac04371e3 (diff)
Merge pull request #476 from qlyoung/abort-select-fd
lib: abort if fd >= FD_SETSIZE and using select
Diffstat (limited to 'lib/thread.c')
-rw-r--r--lib/thread.c6
1 files changed, 6 insertions, 0 deletions
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;