Skip deleted timers when calculting next timeout

It is possible for there to be deleted timers when we
calculate the next timeout, and they must be skipped.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2012-11-22 16:43:57 +00:00
parent 39064f0ff9
commit afbd96678e

View File

@ -332,6 +332,8 @@ static int virEventPollCalculateTimeout(int *timeout) {
EVENT_DEBUG("Calculate expiry of %zu timers", eventLoop.timeoutsCount);
/* Figure out if we need a timeout */
for (i = 0 ; i < eventLoop.timeoutsCount ; i++) {
if (eventLoop.timeouts[i].deleted)
continue;
if (eventLoop.timeouts[i].frequency < 0)
continue;