diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2010-01-05 15:53:33 -0800 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-01-05 15:53:33 -0800 |
commit | ded3e33a21945a95394dd092bfd34f145b8c6138 (patch) | |
tree | 864dc846fb6297e22bd05c6730d239e8a9fcce05 /src | |
parent | d4a67c5eafbd2ba90f146bb5c3942d9d6d130371 (diff) | |
download | connman-ded3e33a21945a95394dd092bfd34f145b8c6138.tar.gz connman-ded3e33a21945a95394dd092bfd34f145b8c6138.tar.bz2 connman-ded3e33a21945a95394dd092bfd34f145b8c6138.zip |
Allow counters with zero interval
Diffstat (limited to 'src')
-rw-r--r-- | src/counter.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/counter.c b/src/counter.c index ae165e4e..d897fb59 100644 --- a/src/counter.c +++ b/src/counter.c @@ -99,9 +99,6 @@ int __connman_counter_register(const char *owner, const char *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; @@ -116,7 +113,8 @@ int __connman_counter_register(const char *owner, const char *path, 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, |