summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: af40f31)
raw | patch | inline | side by side (parent: af40f31)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 28 Nov 2013 17:17:28 +0000 (18:17 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 28 Nov 2013 17:17:28 +0000 (18:17 +0100) |
src/core/store.c | patch | blob | history | |
src/include/core/store.h | patch | blob | history |
diff --git a/src/core/store.c b/src/core/store.c
index be307c5829adb49f212a478f13cb4d34c82983e4..587c527a5185699efe18d104d65f499c12801145 100644 (file)
--- a/src/core/store.c
+++ b/src/core/store.c
char errbuf[1024];
sdb_log(SDB_LOG_ERR, "store: Failed to retrieve attributes: %s\n",
sdb_strerror(errno, errbuf, sizeof(errbuf)));
- break;
+ sdb_strbuf_append(buf, "{\"error\": \"failed to retrieve "
+ "attributes: %s\"}", errbuf);
}
+ /* has_next returns false if the iterator is NULL */
while (sdb_llist_iter_has_next(attr_iter)) {
sdb_attribute_t *attr = SDB_ATTR(sdb_llist_iter_get_next(attr_iter));
assert(attr);
char errbuf[1024];
sdb_log(SDB_LOG_ERR, "store: Failed to retrieve services: %s\n",
sdb_strerror(errno, errbuf, sizeof(errbuf)));
- break;
+ sdb_strbuf_append(buf, "{\"error\": \"failed to retrieve "
+ "services: %s\"}", errbuf);
}
while (sdb_llist_iter_has_next(svc_iter)) {
index bef29ba97add3241950af85303c158a27fcc4272..bc4de1090f6d4a95e980835cf7c4033002776e79 100644 (file)
--- a/src/include/core/store.h
+++ b/src/include/core/store.h
/*
* sdb_store_tojson:
- * Serialize the entire store to JSON and write the result to the specified
+ * Serialize the entire store to JSON and append the result to the specified
* buffer.
*
* Returns: