Skip to content

Commit

Permalink
fixed the condition determining if reducing the polling timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Guzzo committed Dec 17, 2014
1 parent 33f389a commit 27ded6f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/iomux.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,8 +1114,9 @@ iomux_run(iomux_t *iomux, struct timeval *tv_default)
}


if ((!tv_default && (expire_min.tv_sec || expire_min.tv_usec)) ||
(tv_default != &expire_min && timercmp(tv_default, &expire_min, >)))
if (!tv_default ||
((expire_min.tv_sec || expire_min.tv_usec) &&
tv_default != &expire_min && timercmp(tv_default, &expire_min, >)))
{
tv_default = &expire_min;
}
Expand Down Expand Up @@ -1228,8 +1229,9 @@ iomux_run(iomux_t *iomux, struct timeval *tv_default)

MUTEX_UNLOCK(iomux);

if ((!tv_default && (expire_min.tv_sec || expire_min.tv_usec)) ||
(tv_default != &expire_min && timercmp(tv_default, &expire_min, >)))
if (!tv_default ||
((expire_min.tv_sec || expire_min.tv_usec) &&
tv_default != &expire_min && timercmp(tv_default, &expire_min, >)))
{
tv_default = &expire_min;
}
Expand Down Expand Up @@ -1352,8 +1354,9 @@ iomux_run(iomux_t *iomux, struct timeval *tv_default)

}

if ((!tv_default && (expire_min.tv_sec || expire_min.tv_usec)) ||
(tv_default != &expire_min && timercmp(tv_default, &expire_min, >)))
if (!tv_default ||
((expire_min.tv_sec || expire_min.tv_usec) &&
tv_default != &expire_min && timercmp(tv_default, &expire_min, >)))
{
tv_default = &expire_min;
}
Expand Down

0 comments on commit 27ded6f

Please sign in to comment.