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:
parent
139f1f1548
commit
0cc0c3d503
@ -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() */
|
||||
|
Loading…
Reference in New Issue
Block a user