* 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
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);
}
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;
{
int fd;
- if (inotify->channel == NULL)
+ if (!inotify->channel)
return;
if (inotify->watch > 0)
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;
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);