Win32: avoid crash when waiting forever on zero fds.

This commit is contained in:
Nick Mathewson 2012-07-16 15:34:18 -04:00
parent be7a95c629
commit 160e58b67d

View File

@ -298,7 +298,7 @@ win32_dispatch(struct event_base *base, struct timeval *tv)
win32op->readset_out->fd_count : win32op->writeset_out->fd_count;
if (!fd_count) {
long msec = evutil_tv_to_msec(tv);
long msec = tv ? evutil_tv_to_msec(tv) : LONG_MAX;
/* Sleep's DWORD argument is unsigned long */
if (msec < 0)
msec = LONG_MAX;