mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-25 18:14:53 +00:00
lwip_selscan: lwip_selscan return -1 without setting errno number
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
parent
fc5b6f7b0e
commit
b00a05d086
@ -2111,7 +2111,9 @@ lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset,
|
||||
/* Call lwip_selscan again: there could have been events between
|
||||
the last scan (without us on the list) and putting us on the list! */
|
||||
nready = lwip_selscan(maxfdp1, readset, writeset, exceptset, &lreadset, &lwriteset, &lexceptset);
|
||||
if (!nready) {
|
||||
if (nready < 0) {
|
||||
set_errno(EBADF);
|
||||
} else if (!nready) {
|
||||
/* Still none ready, just wait to be woken */
|
||||
if (timeout == 0) {
|
||||
/* Wait forever */
|
||||
@ -2185,6 +2187,11 @@ lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset,
|
||||
/* See what's set now after waiting */
|
||||
nready = lwip_selscan(maxfdp1, readset, writeset, exceptset, &lreadset, &lwriteset, &lexceptset);
|
||||
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_select: nready=%d\n", nready));
|
||||
if (nready < 0) {
|
||||
set_errno(EBADF);
|
||||
lwip_select_dec_sockets_used(maxfdp1, &used_sockets);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user