fs/vfs: Fix bug that select() did not return

Fix bug that select() did not return when the nfds argument
was set to a negative value. The specification is that -1 is
set to the return value and EINVAL is set to errno.
This commit is contained in:
SPRESENSE 2021-05-19 18:44:52 +09:00 committed by Xiang Xiao
parent 139f1f1548
commit 0cc0c3d503

View File

@ -90,6 +90,12 @@ int select(int nfds, FAR fd_set *readfds, FAR fd_set *writefds,
enter_cancellation_point();
if (nfds < 0)
{
errcode = EINVAL;
goto errout;
}
/* How many pollfd structures do we need to allocate? */
/* Initialize the descriptor list for poll() */