Merge "Optional autogen.sh flag --enable-kdbus-transport added allowing to compile...
[platform/upstream/dbus.git] / bus / expirelist.c
index 3c87c11..9a3886e 100644 (file)
@@ -123,9 +123,9 @@ bus_expire_list_recheck_immediately (BusExpireList *list)
 }
 
 static int
-do_expiration_with_current_time (BusExpireList *list,
-                                 long           tv_sec,
-                                 long           tv_usec)
+do_expiration_with_monotonic_time (BusExpireList *list,
+                                   long           tv_sec,
+                                   long           tv_usec)
 {
   DBusList *link;
   int next_interval, min_wait_time, items_to_expire;
@@ -194,9 +194,9 @@ bus_expirelist_expire (BusExpireList *list)
     {
       long tv_sec, tv_usec;
 
-      _dbus_get_current_time (&tv_sec, &tv_usec);
+      _dbus_get_monotonic_time (&tv_sec, &tv_usec);
 
-      next_interval = do_expiration_with_current_time (list, tv_sec, tv_usec);
+      next_interval = do_expiration_with_monotonic_time (list, tv_sec, tv_usec);
     }
 
   bus_expire_timeout_set_interval (list->timeout, next_interval);
@@ -281,7 +281,7 @@ bus_expire_list_contains_item (BusExpireList *list,
   return _dbus_list_find_last (&list->items, item) != NULL;
 }
 
-#ifdef DBUS_BUILD_TESTS
+#ifdef DBUS_ENABLE_EMBEDDED_TESTS
 
 typedef struct
 {
@@ -340,7 +340,7 @@ bus_expire_list_test (const DBusString *test_data_dir)
                               test_expire_func, NULL);
   _dbus_assert (list != NULL);
 
-  _dbus_get_current_time (&tv_sec, &tv_usec);
+  _dbus_get_monotonic_time (&tv_sec, &tv_usec);
 
   tv_sec_not_expired = tv_sec;
   tv_usec_not_expired = tv_usec;
@@ -367,22 +367,22 @@ bus_expire_list_test (const DBusString *test_data_dir)
     _dbus_assert_not_reached ("out of memory");
 
   next_interval =
-    do_expiration_with_current_time (list, tv_sec_not_expired,
-                                     tv_usec_not_expired);
+    do_expiration_with_monotonic_time (list, tv_sec_not_expired,
+                                       tv_usec_not_expired);
   _dbus_assert (item->expire_count == 0);
   _dbus_verbose ("next_interval = %d\n", next_interval);
   _dbus_assert (next_interval == 1);
   
   next_interval =
-    do_expiration_with_current_time (list, tv_sec_expired,
-                                     tv_usec_expired);
+    do_expiration_with_monotonic_time (list, tv_sec_expired,
+                                       tv_usec_expired);
   _dbus_assert (item->expire_count == 1);
   _dbus_verbose ("next_interval = %d\n", next_interval);
   _dbus_assert (next_interval == -1);
 
   next_interval =
-    do_expiration_with_current_time (list, tv_sec_past,
-                                     tv_usec_past);
+    do_expiration_with_monotonic_time (list, tv_sec_past,
+                                       tv_usec_past);
   _dbus_assert (item->expire_count == 1);
   _dbus_verbose ("next_interval = %d\n", next_interval);
   _dbus_assert (next_interval == 1000 + EXPIRE_AFTER);
@@ -399,4 +399,4 @@ bus_expire_list_test (const DBusString *test_data_dir)
   return result;
 }
 
-#endif /* DBUS_BUILD_TESTS */
+#endif /* DBUS_ENABLE_EMBEDDED_TESTS */