summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2012-05-24 16:25:01 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-05-28 17:00:45 +0300
commit1f854740a04fad3f36ac912514c48d59ca6cffec (patch)
tree4b9454936f44770779fe8933bb64955b1b232021 /src
parenta9f7f23c5ab1523f8ede042bcf6b4fd3eb8acb06 (diff)
downloadconnman-1f854740a04fad3f36ac912514c48d59ca6cffec.tar.gz
connman-1f854740a04fad3f36ac912514c48d59ca6cffec.tar.bz2
connman-1f854740a04fad3f36ac912514c48d59ca6cffec.zip
resolver: Clean up remove function
A search domain will have it's server attribute set to NULL, thus remove that explicit check. Also when comparing entry elements to the given attributes, consider NULL being equal to NULL.
Diffstat (limited to 'src')
-rw-r--r--src/resolver.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/resolver.c b/src/resolver.c
index 3ce74c32..a9d13412 100644
--- a/src/resolver.c
+++ b/src/resolver.c
@@ -450,23 +450,20 @@ int connman_resolver_remove(const char *interface, const char *domain,
DBG("interface %s domain %s server %s", interface, domain, server);
- if (server == NULL)
- return -EINVAL;
-
for (list = entry_list; list; list = list->next) {
struct entry_data *entry = list->data;
- if (interface != NULL &&
- g_strcmp0(entry->interface, interface) != 0)
+ if (g_strcmp0(entry->interface, interface) != 0)
continue;
- if (domain != NULL && g_strcmp0(entry->domain, domain) != 0)
+ if (g_strcmp0(entry->domain, domain) != 0)
continue;
if (g_strcmp0(entry->server, server) != 0)
continue;
matches = g_slist_append(matches, entry);
+ break;
}
if (matches == NULL)