Fix infinite loop in timeout handling on Windows.

This commit is contained in:
Guus Sliepen 2012-12-07 15:49:21 +01:00
parent 58026f72a1
commit c26581e29f

View file

@ -58,7 +58,7 @@ extern int usleep(long long usec);
#define timersub(a, b, r) do {\ #define timersub(a, b, r) do {\
(r)->tv_sec = (a)->tv_sec - (b)->tv_sec;\ (r)->tv_sec = (a)->tv_sec - (b)->tv_sec;\
(r)->tv_usec = (a)->tv_usec - (b)->tv_usec;\ (r)->tv_usec = (a)->tv_usec - (b)->tv_usec;\
if((r)->tv_usec < 1000000)\ if((r)->tv_usec < 0)\
(r)->tv_sec--, (r)->tv_usec += 1000000;\ (r)->tv_sec--, (r)->tv_usec += 1000000;\
} while (0) } while (0)
#endif #endif