diff options
author | Zhang zhengguang <zhengguang.zhang@intel.com> | 2014-07-17 10:37:39 +0800 |
---|---|---|
committer | Zhang zhengguang <zhengguang.zhang@intel.com> | 2014-07-17 10:37:39 +0800 |
commit | 1b9d0a62f59bb48c8deb2f0b98d9acdffdd9abe7 (patch) | |
tree | 6e991827d28537f7f40f20786c2354fd04a9fdad /src/inotify.c | |
parent | fbe905ab58ecc31fe64c410c5f580cadc30e7f04 (diff) | |
download | connman-1b9d0a62f59bb48c8deb2f0b98d9acdffdd9abe7.tar.gz connman-1b9d0a62f59bb48c8deb2f0b98d9acdffdd9abe7.tar.bz2 connman-1b9d0a62f59bb48c8deb2f0b98d9acdffdd9abe7.zip |
Imported Upstream version 1.24upstream/1.24
Diffstat (limited to 'src/inotify.c')
-rw-r--r-- | src/inotify.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/inotify.c b/src/inotify.c index f451f1c0..72ba6f68 100644 --- a/src/inotify.c +++ b/src/inotify.c @@ -3,7 +3,7 @@ * Connection Manager * * Copyright (C) 2007-2012 Intel Corporation. All rights reserved. - * Copyright (C) 2012 BMW Car IT GmbH. All rights reserved. + * Copyright (C) 2012-2013 BMW Car IT GmbH. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -95,7 +95,7 @@ static gboolean inotify_data(GIOChannel *channel, GIOCondition cond, next_event += len; bytes_read -= len; - for (list = inotify->list; list != NULL; list = list->next) { + for (list = inotify->list; list; list = list->next) { inotify_event_cb callback = list->data; (*callback)(event, ident); @@ -125,7 +125,7 @@ static int create_watch(const char *path, struct connman_inotify *inotify) } inotify->channel = g_io_channel_unix_new(fd); - if (inotify->channel == NULL) { + if (!inotify->channel) { connman_error("Creation of inotify channel failed"); inotify_rm_watch(fd, inotify->wd); inotify->wd = 0; @@ -149,7 +149,7 @@ static void remove_watch(struct connman_inotify *inotify) { int fd; - if (inotify->channel == NULL) + if (!inotify->channel) return; if (inotify->watch > 0) @@ -168,15 +168,15 @@ int connman_inotify_register(const char *path, inotify_event_cb callback) struct connman_inotify *inotify; int err; - if (callback == NULL) + if (!callback) return -EINVAL; inotify = g_hash_table_lookup(inotify_hash, path); - if (inotify != NULL) + if (inotify) goto update; inotify = g_try_new0(struct connman_inotify, 1); - if (inotify == NULL) + if (!inotify) return -ENOMEM; inotify->wd = -1; @@ -210,11 +210,11 @@ void connman_inotify_unregister(const char *path, inotify_event_cb callback) struct connman_inotify *inotify; inotify = g_hash_table_lookup(inotify_hash, path); - if (inotify == NULL) + if (!inotify) return; inotify->list = g_slist_remove(inotify->list, callback); - if (inotify->list != NULL) + if (inotify->list) return; g_hash_table_remove(inotify_hash, path); |