chiark / gitweb /
core: include following set data in dump
authorLennart Poettering <lennart@poettering.net>
Mon, 25 Nov 2013 20:16:37 +0000 (21:16 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 25 Nov 2013 21:10:22 +0000 (22:10 +0100)
src/core/unit.c
src/core/unit.h

index 894485f6d72be6275c1b9871d42f10a273fc02ef..57f0a86c01ad4d23af512066bf262cd1dbbdab87 100644 (file)
@@ -716,6 +716,8 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) {
                 timestamp4[FORMAT_TIMESTAMP_MAX],
                 timespan[FORMAT_TIMESPAN_MAX];
         Unit *following;
+        _cleanup_set_free_ Set *following_set = NULL;
+        int r;
 
         assert(u);
         assert(u->type >= 0);
@@ -767,9 +769,18 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) {
         STRV_FOREACH(j, u->documentation)
                 fprintf(f, "%s\tDocumentation: %s\n", prefix, *j);
 
-        if ((following = unit_following(u)))
+        following = unit_following(u);
+        if (following)
                 fprintf(f, "%s\tFollowing: %s\n", prefix, following->id);
 
+        r = unit_following_set(u, &following_set);
+        if (r >= 0) {
+                Unit *other;
+
+                SET_FOREACH(other, following_set, i)
+                        fprintf(f, "%s\tFollowing Set Member: %s\n", prefix, other->id);
+        }
+
         if (u->fragment_path)
                 fprintf(f, "%s\tFragment Path: %s\n", prefix, u->fragment_path);
 
index 5b4f86c58470d96efd7ee4f9b4de2b4130275a19..fe49b57403a7ba01f523291ac86a2edaffb02786 100644 (file)
@@ -558,6 +558,7 @@ bool unit_need_daemon_reload(Unit *u);
 void unit_reset_failed(Unit *u);
 
 Unit *unit_following(Unit *u);
+int unit_following_set(Unit *u, Set **s);
 
 const char *unit_slice_name(Unit *u);
 
@@ -569,8 +570,6 @@ int unit_add_default_target_dependency(Unit *u, Unit *target);
 
 char *unit_default_cgroup_path(Unit *u);
 
-int unit_following_set(Unit *u, Set **s);
-
 void unit_start_on_failure(Unit *u);
 void unit_trigger_notify(Unit *u);