chiark / gitweb /
service: always sort services from suse B runlevel before services from normal runlevels
[elogind.git] / src / unit.c
index 5807e4f4d1cbd2432ab48e07d829a363641a9984..840c1d1fc450556e56ce79b87045b1980eece2d0 100644 (file)
@@ -589,6 +589,7 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) {
                 timestamp3[FORMAT_TIMESTAMP_MAX],
                 timestamp4[FORMAT_TIMESTAMP_MAX],
                 timespan[FORMAT_TIMESPAN_MAX];
+        Unit *following;
 
         assert(u);
         assert(u->meta.type >= 0);
@@ -625,6 +626,9 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) {
         SET_FOREACH(t, u->meta.names, i)
                 fprintf(f, "%s\tName: %s\n", prefix, t);
 
+        if ((following = unit_following(u)))
+                fprintf(f, "%s\tFollowing: %s\n", prefix, following->meta.id);
+
         if (u->meta.fragment_path)
                 fprintf(f, "%s\tFragment Path: %s\n", prefix, u->meta.fragment_path);
 
@@ -2078,6 +2082,15 @@ void unit_reset_maintenance(Unit *u) {
                 UNIT_VTABLE(u)->reset_maintenance(u);
 }
 
+Unit *unit_following(Unit *u) {
+        assert(u);
+
+        if (UNIT_VTABLE(u)->following)
+                return UNIT_VTABLE(u)->following(u);
+
+        return NULL;
+}
+
 static const char* const unit_type_table[_UNIT_TYPE_MAX] = {
         [UNIT_SERVICE] = "service",
         [UNIT_TIMER] = "timer",