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 7db1c4ab33db325501af4539703bb44e44adce16..ffbc58463ce95c6f6fbe4c67c4f40020fd2a209d 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)