summaryrefslogtreecommitdiff
path: root/slabs.c
diff options
context:
space:
mode:
Diffstat (limited to 'slabs.c')
-rw-r--r--slabs.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/slabs.c b/slabs.c
index ab9f633..25461ac 100644
--- a/slabs.c
+++ b/slabs.c
@@ -311,13 +311,13 @@ char *get_stats(const bool bin_prot, const char *stat_type,
int size = 0;
*buflen = 0;
- if(!stat_type) {
- if((buf = malloc(512)) == NULL)
+ if (!stat_type) {
+ if ((buf = malloc(512)) == NULL)
return NULL;
pos = buf;
- if(bin_prot) {
- if(add_stats == NULL) {
+ if (bin_prot) {
+ if (add_stats == NULL) {
free(buf);
return NULL;
}
@@ -353,7 +353,12 @@ char *get_stats(const bool bin_prot, const char *stat_type,
*buflen = strlen(buf);
return buf;
}
+ } else if (strcmp(stat_type, "items") == 0) {
+ buf = item_stats(&size, add_stats, bin_prot);
+ *buflen = size;
+ return buf;
}
+
return NULL;
}