chiark / gitweb /
service: don't create sysv order deps on merged units
[elogind.git] / src / unit.c
index 5a451c57c2a038c1cc297c7d3658f96527ab206e..5960c277b7dc60d0db724bd8a8ec8e7295c63844 100644 (file)
@@ -578,7 +578,7 @@ const char *unit_description(Unit *u) {
         if (u->meta.description)
                 return u->meta.description;
 
-        return u->meta.id;
+        return strna(u->meta.id);
 }
 
 void unit_dump(Unit *u, FILE *f, const char *prefix) {
@@ -1403,6 +1403,9 @@ int unit_add_dependency(Unit *u, UnitDependency d, Unit *other, bool add_referen
         assert(d >= 0 && d < _UNIT_DEPENDENCY_MAX);
         assert(other);
 
+        u = unit_follow_merge(u);
+        other = unit_follow_merge(other);
+
         /* We won't allow dependencies on ourselves. We will not
          * consider them an error however. */
         if (u == other)