chiark / gitweb /
core: convert PID 1 to libsystemd-bus
[elogind.git] / src / libsystemd-bus / bus-introspect.c
index 31788782edee19888cf0c8b01f20237f2db0cf1c..4c6031729ab1ae1eba164ed4f77a31b6f0dd6567 100644 (file)
@@ -63,7 +63,7 @@ int introspect_write_child_nodes(struct introspect *i, Set *s, const char *prefi
                 const char *e;
 
                 e = object_path_startswith(node, prefix);
-                if (e)
+                if (e && e[0])
                         fprintf(i->f, " <node name=\"%s\"/>\n", e);
 
                 free(node);
@@ -103,21 +103,18 @@ static int introspect_write_arguments(struct introspect *i, const char *signatur
                 fprintf(i->f, "   <arg type=\"%.*s\"", (int) l, signature);
 
                 if (direction)
-                        fprintf(i->f, " direction=\"%s\">\n", direction);
+                        fprintf(i->f, " direction=\"%s\"/>\n", direction);
                 else
-                        fputs(">\n", i->f);
+                        fputs("/>\n", i->f);
 
                 signature += l;
         }
 }
 
-int introspect_write_interface(struct introspect *i, const char *interface, const sd_bus_vtable *v) {
+int introspect_write_interface(struct introspect *i, const sd_bus_vtable *v) {
         assert(i);
-        assert(interface);
         assert(v);
 
-        fprintf(i->f, " <interface name=\"%s\">\n", interface);
-
         for (; v->type != _SD_BUS_VTABLE_END; v++) {
 
                 switch (v->type) {
@@ -155,7 +152,6 @@ int introspect_write_interface(struct introspect *i, const char *interface, cons
 
         }
 
-        fputs(" </interface>\n", i->f);
         return 0;
 }