summaryrefslogtreecommitdiff
path: root/src/counter.c
diff options
context:
space:
mode:
authorZhang zhengguang <zhengguang.zhang@intel.com>2014-07-17 02:37:39 (GMT)
committerZhang zhengguang <zhengguang.zhang@intel.com>2014-07-17 02:37:39 (GMT)
commit1b9d0a62f59bb48c8deb2f0b98d9acdffdd9abe7 (patch)
tree6e991827d28537f7f40f20786c2354fd04a9fdad /src/counter.c
parentfbe905ab58ecc31fe64c410c5f580cadc30e7f04 (diff)
downloadconnman-1b9d0a62f59bb48c8deb2f0b98d9acdffdd9abe7.zip
connman-1b9d0a62f59bb48c8deb2f0b98d9acdffdd9abe7.tar.gz
connman-1b9d0a62f59bb48c8deb2f0b98d9acdffdd9abe7.tar.bz2
Imported Upstream version 1.24upstream/1.24
Diffstat (limited to 'src/counter.c')
-rw-r--r--src/counter.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/counter.c b/src/counter.c
index 76d91d4..06e5daf 100644
--- a/src/counter.c
+++ b/src/counter.c
@@ -75,11 +75,11 @@ int __connman_counter_register(const char *owner, const char *path,
DBG("owner %s path %s interval %u", owner, path, interval);
counter = g_hash_table_lookup(counter_table, path);
- if (counter != NULL)
+ if (counter)
return -EEXIST;
counter = g_try_new0(struct connman_counter, 1);
- if (counter == NULL)
+ if (!counter)
return -ENOMEM;
counter->owner = g_strdup(owner);
@@ -112,7 +112,7 @@ int __connman_counter_unregister(const char *owner, const char *path)
DBG("owner %s path %s", owner, path);
counter = g_hash_table_lookup(counter_table, path);
- if (counter == NULL)
+ if (!counter)
return -ESRCH;
if (g_strcmp0(owner, counter->owner) != 0)
@@ -133,7 +133,7 @@ void __connman_counter_send_usage(const char *path,
struct connman_counter *counter;
counter = g_hash_table_lookup(counter_table, path);
- if (counter == NULL)
+ if (!counter)
return;
dbus_message_set_destination(message, counter->owner);
@@ -157,7 +157,7 @@ static void release_counter(gpointer key, gpointer value, gpointer user_data)
message = dbus_message_new_method_call(counter->owner, counter->path,
CONNMAN_COUNTER_INTERFACE, "Release");
- if (message == NULL)
+ if (!message)
return;
dbus_message_set_no_reply(message, TRUE);
@@ -170,7 +170,7 @@ int __connman_counter_init(void)
DBG("");
connection = connman_dbus_get_connection();
- if (connection == NULL)
+ if (!connection)
return -1;
counter_table = g_hash_table_new_full(g_str_hash, g_str_equal,
@@ -185,7 +185,7 @@ void __connman_counter_cleanup(void)
{
DBG("");
- if (connection == NULL)
+ if (!connection)
return;
g_hash_table_foreach(counter_table, release_counter, NULL);