Register a new counter for user notifications.
+ If the interval is zero then no timer for updates
+ will be started. Only kernel events can then
+ trigger updates. Otherwise the kernel will be
+ polled every n seconds for an update.
+
Possible Errors: [service].Error.InvalidArguments
void UnregisterCounter(object path)
DBG("owner %s path %s interval %u", owner, path, interval);
- if (interval < 1)
- return -EINVAL;
-
counter = g_hash_table_lookup(counter_table, path);
if (counter != NULL)
return -EEXIST;
g_hash_table_replace(counter_table, counter->path, counter);
g_hash_table_replace(owner_mapping, counter->owner, counter);
- counter->timeout = g_timeout_add_seconds(interval,
+ if (interval > 0)
+ counter->timeout = g_timeout_add_seconds(interval,
counter_timeout, counter);
counter->watch = g_dbus_add_disconnect_watch(connection, owner,