mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
select: fix too small timeout will be counted as 0
avoiding timeouts less than 1ms may lead to busyloop Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
parent
1569621149
commit
1bf71795fc
1 changed files with 1 additions and 1 deletions
|
|
@ -204,7 +204,7 @@ int select(int nfds, FAR fd_set *readfds, FAR fd_set *writefds,
|
|||
{
|
||||
/* Calculate the timeout in milliseconds */
|
||||
|
||||
msec = timeout->tv_sec * 1000 + timeout->tv_usec / 1000;
|
||||
msec = timeout->tv_sec * 1000 + (timeout->tv_usec + 999) / 1000;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue