Expire list timeout may be negative for no expiry.
authorScott James Remnant <scott@ubuntu.com>
Mon, 11 May 2009 21:42:50 +0000 (22:42 +0100)
committerScott James Remnant <scott@ubuntu.com>
Thu, 28 May 2009 09:47:35 +0000 (11:47 +0200)
* bus/expirelist.c (do_expiration_with_current_time): Don't check for
  expiry if expire_after is negative, will just disable the expiry timer
  after the call.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
bus/expirelist.c

index 038cfee..8cf1fad 100644 (file)
@@ -158,7 +158,7 @@ do_expiration_with_current_time (BusExpireList *list,
                                             tv_sec, tv_usec);
 
       if (((item->added_tv_sec == 0) && (item->added_tv_usec == 0)) ||
-                     (elapsed >= (double) list->expire_after))
+          ((list->expire_after > 0) && (elapsed >= (double) list->expire_after)))
         {
           _dbus_verbose ("Expiring an item %p\n", item);
 
@@ -174,7 +174,7 @@ do_expiration_with_current_time (BusExpireList *list,
               break;
             }
         }
-      else
+      else if (list->expire_after > 0)
         {
           double to_wait;