sched: check that added file descriptor fits in fd_set

This commit is contained in:
Miroslav Lichvar 2014-08-15 16:36:00 +02:00
parent a2b40f527d
commit 07f7f28058

View file

@ -169,6 +169,9 @@ SCH_AddInputFileHandler
assert(initialised); assert(initialised);
if (fd >= FD_SETSIZE)
LOG_FATAL(LOGF_Scheduler, "Too many file descriptors");
/* Don't want to allow the same fd to register a handler more than /* Don't want to allow the same fd to register a handler more than
once without deleting a previous association - this suggests once without deleting a previous association - this suggests
a bug somewhere else in the program. */ a bug somewhere else in the program. */