dont list services that have no instances
authorJohn Crispin <blogic@openwrt.org>
Mon, 8 Jul 2013 20:12:28 +0000 (22:12 +0200)
committerJohn Crispin <blogic@openwrt.org>
Mon, 8 Jul 2013 21:01:49 +0000 (23:01 +0200)
Signed-off-by: John Crispin <blogic@openwrt.org>
service.c

index 7db1c4a..ffbc584 100644 (file)
--- 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)