diff --git a/fs/vfs/fs_select.c b/fs/vfs/fs_select.c index d8393a8cb2c..fde14c2a9fb 100644 --- a/fs/vfs/fs_select.c +++ b/fs/vfs/fs_select.c @@ -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 {