diff --git a/src/core/store_json.c b/src/core/store_json.c
index 4fd309b3ec4ac6fa81f982fd9e71b2d3226d0af7..961e54c0606ae84206d1199758506ad4ff212cbf 100644 (file)
--- a/src/core/store_json.c
+++ b/src/core/store_json.c
int
sdb_store_emit(sdb_store_obj_t *obj, sdb_store_writer_t *w, sdb_object_t *wd)
{
int
sdb_store_emit(sdb_store_obj_t *obj, sdb_store_writer_t *w, sdb_object_t *wd)
{
- if ((! obj) || (! w)
- || (! w->store_host) || (! w->store_service)
- || (! w->store_metric) || (! w->store_attribute))
+ if ((! obj) || (! w))
return -1;
switch (obj->type) {
return -1;
switch (obj->type) {
(const char * const *)obj->backends,
obj->backends_num,
};
(const char * const *)obj->backends,
obj->backends_num,
};
+ if (! w->store_host)
+ return -1;
return w->store_host(&host, wd);
}
case SDB_SERVICE:
return w->store_host(&host, wd);
}
case SDB_SERVICE:
(const char * const *)obj->backends,
obj->backends_num,
};
(const char * const *)obj->backends,
obj->backends_num,
};
+ if (! w->store_service)
+ return -1;
return w->store_service(&service, wd);
}
case SDB_METRIC:
return w->store_service(&service, wd);
}
case SDB_METRIC:
(const char * const *)obj->backends,
obj->backends_num,
};
(const char * const *)obj->backends,
obj->backends_num,
};
+ if (! w->store_metric)
+ return -1;
return w->store_metric(&metric, wd);
}
case SDB_ATTRIBUTE:
return w->store_metric(&metric, wd);
}
case SDB_ATTRIBUTE:
if (obj->parent && (obj->parent->type != SDB_HOST)
&& obj->parent->parent)
attr.hostname = obj->parent->parent->_name;
if (obj->parent && (obj->parent->type != SDB_HOST)
&& obj->parent->parent)
attr.hostname = obj->parent->parent->_name;
+ if (! w->store_attribute)
+ return -1;
return w->store_attribute(&attr, wd);
}
}
return w->store_attribute(&attr, wd);
}
}