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:
Vadim Zeitlin 2010-11-09 23:53:33 +00:00
parent bbacbe3980
commit 947d5ad04c

View File

@ -220,8 +220,8 @@ int wxSelectDispatcher::DoSelect(wxSelectSets& sets, int timeout) const
if ( timeout != TIMEOUT_INFINITE )
{
ptv = &tv;
tv.tv_sec = 0;
tv.tv_usec = timeout*1000;
tv.tv_sec = timeout / 1000;
tv.tv_usec = (timeout % 1000)*1000;
}
else // no timeout
{