]> xenbits.xensource.com Git - people/dariof/libvirt.git/commitdiff
Skip deleted timers when calculting next timeout
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 22 Nov 2012 16:43:57 +0000 (16:43 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 23 Nov 2012 10:11:55 +0000 (10:11 +0000)
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>
src/util/event_poll.c

index e3907c4f26ea82273ba7f65142b48ce2865149fb..7a83a370797a6fc87ece57662bd65a7bfb09b8ca 100644 (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;