summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 85d2449)
raw | patch | inline | side by side (parent: 85d2449)
author | Sebastian Harl <sh@tokkee.org> | |
Wed, 24 Jul 2013 01:45:40 +0000 (18:45 -0700) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Wed, 24 Jul 2013 01:45:40 +0000 (18:45 -0700) |
… and make the function return a boolean value. We don't currently need a
function to access the actual host object. So, don't expose it that way.
function to access the actual host object. So, don't expose it that way.
src/backend/collectd/unixsock.c | patch | blob | history | |
src/core/store.c | patch | blob | history | |
src/include/core/store.h | patch | blob | history |
index 7e4f73a2d20bfab567f116446f5caed1dd37c33b..762539c4f9cf3ed5ef41b1039c9d2e40ad21105c 100644 (file)
return -1;
}
- if (! sdb_store_get_host(hostname))
+ if (! sdb_store_has_host(hostname))
sdb_collectd_add_host(hostname, last_update);
if (sdb_collectd_add_svc(hostname, plugin, type, last_update))
diff --git a/src/core/store.c b/src/core/store.c
index a5f712ef72729636b1a4f9a3606bfc9b44b0a15a..b9335818c203a753cd3fa84ae2db18b270e7cfe7 100644 (file)
--- a/src/core/store.c
+++ b/src/core/store.c
return status;
} /* sdb_store_host */
-const sdb_host_t *
-sdb_store_get_host(const char *name)
+_Bool
+sdb_store_has_host(const char *name)
{
sdb_host_t *host;
return NULL;
host = SDB_HOST(sdb_llist_search_by_name(host_list, name));
- if (! host)
- return NULL;
- return host;
-} /* sdb_store_get_host */
+ return host != NULL;
+} /* sdb_store_has_host */
sdb_attribute_t *
sdb_attribute_create(const char *hostname,
index 563bd1a1dc2cbc1c744e477525eab5d1e0c246f0..aac884a5d104a72cd747c3db83ffa0f8b478a5c7 100644 (file)
--- a/src/include/core/store.h
+++ b/src/include/core/store.h
int
sdb_store_host(const char *name, sdb_time_t last_update);
-const sdb_host_t *
-sdb_store_get_host(const char *name);
+_Bool
+sdb_store_has_host(const char *name);
sdb_attribute_t *
sdb_attribute_create(const char *hostname,