mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08: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:
+1
-1
@@ -204,7 +204,7 @@ int select(int nfds, FAR fd_set *readfds, FAR fd_set *writefds,
|
|||||||
{
|
{
|
||||||
/* Calculate the timeout in milliseconds */
|
/* 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
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user