Fix timeval struct initialization in wxSelectDispatcher.
The tv_usec field could overflow its maximal value while tv_sec was always left 0. It would be even better to reuse SetTimeValFromMS() from socket.cpp here in the future. See #11542. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66076 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
bbacbe3980
commit
947d5ad04c
@ -220,8 +220,8 @@ int wxSelectDispatcher::DoSelect(wxSelectSets& sets, int timeout) const
|
|||||||
if ( timeout != TIMEOUT_INFINITE )
|
if ( timeout != TIMEOUT_INFINITE )
|
||||||
{
|
{
|
||||||
ptv = &tv;
|
ptv = &tv;
|
||||||
tv.tv_sec = 0;
|
tv.tv_sec = timeout / 1000;
|
||||||
tv.tv_usec = timeout*1000;
|
tv.tv_usec = (timeout % 1000)*1000;
|
||||||
}
|
}
|
||||||
else // no timeout
|
else // no timeout
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user