summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2013-07-08 22:12:28 +0200
committerJohn Crispin <blogic@openwrt.org>2013-07-08 23:01:49 +0200
commit5bf4764d977d35c2075fc183bd75ef5b28a03cb4 (patch)
treeb7fe4f73836a665920173f4f666135bafc0e241f
parent8643c5876241474be551980e51740f2dcb8046bd (diff)
downloadunitd-5bf4764d977d35c2075fc183bd75ef5b28a03cb4.tar
unitd-5bf4764d977d35c2075fc183bd75ef5b28a03cb4.zip
dont list services that have no instances
Signed-off-by: John Crispin <blogic@openwrt.org>
-rw-r--r--service.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/service.c b/service.c
index 7db1c4a..ffbc584 100644
--- a/service.c
+++ b/service.c
@@ -212,6 +212,9 @@ service_dump(struct service *s, int verbose)
struct service_instance *in;
void *c, *i;
+ if (avl_is_empty(&s->instances.avl))
+ return;
+
c = blobmsg_open_table(&b, s->name);
i = blobmsg_open_table(&b, "instances");
if (verbose && s->trigger)