summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eb5b915)
raw | patch | inline | side by side (parent: eb5b915)
author | Sebastian Harl <sh@tokkee.org> | |
Sat, 17 Aug 2013 18:10:45 +0000 (20:10 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sat, 17 Aug 2013 18:10:45 +0000 (20:10 +0200) |
Else, host to service mapping is not correct.
src/core/store.c | patch | blob | history |
diff --git a/src/core/store.c b/src/core/store.c
index b013dcdd1683cae08f1a4993121605e0674b5712..1eb22d6c5e2c9be5e1942a711abc3126ce55fdfe 100644 (file)
--- a/src/core/store.c
+++ b/src/core/store.c
sdb_store_service(const char *hostname, const char *name,
sdb_time_t last_update)
{
+ char *cname;
+ int status = 0;
+
if ((! hostname) || (! name))
return -1;
- return store_obj(/* parent = */ SDB_HOST, hostname,
+
+ cname = sdb_plugin_cname(strdup(hostname));
+ if (! cname) {
+ sdb_log(SDB_LOG_ERR, "store: strdup failed");
+ return -1;
+ }
+
+ status = store_obj(/* parent = */ SDB_HOST, cname,
/* stored object = */ SDB_SERVICE, name, last_update);
+ free(cname);
+ return status;
} /* sdb_store_service */
/* TODO: actually support hierarchical data */