mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
vfs/poll: fix timeout calculation
This commit is contained in:
+1
-1
@@ -401,7 +401,7 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout)
|
|||||||
|
|
||||||
#if (MSEC_PER_TICK * USEC_PER_MSEC) != USEC_PER_TICK && \
|
#if (MSEC_PER_TICK * USEC_PER_MSEC) != USEC_PER_TICK && \
|
||||||
defined(CONFIG_HAVE_LONG_LONG)
|
defined(CONFIG_HAVE_LONG_LONG)
|
||||||
ticks = ((unsigned long long)timeout * USEC_PER_MSEC) + (USEC_PER_TICK - 1) /
|
ticks = (((unsigned long long)timeout * USEC_PER_MSEC) + (USEC_PER_TICK - 1)) /
|
||||||
USEC_PER_TICK;
|
USEC_PER_TICK;
|
||||||
#else
|
#else
|
||||||
ticks = ((unsigned int)timeout + (MSEC_PER_TICK - 1)) / MSEC_PER_TICK;
|
ticks = ((unsigned int)timeout + (MSEC_PER_TICK - 1)) / MSEC_PER_TICK;
|
||||||
|
|||||||
Reference in New Issue
Block a user