]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/core/slice.c
core: add default descriptions for slices
[thirdparty/systemd.git] / src / core / slice.c
index 595f704a17a43a3ebe8ed8616ccf3c5d12092980..2e43c00119012742b5f85efbb44ee7fa30cc9eec 100644 (file)
@@ -180,6 +180,14 @@ static int slice_load(Unit *u) {
         if (r < 0)
                 return r;
 
+        if (!u->description) {
+                _cleanup_free_ char *tmp = NULL;
+
+                r = unit_name_to_path(u->id, &tmp);
+                if (r >= 0)  /* Failure is ignored… */
+                        u->description = strjoin("Slice ", tmp);
+        }
+
         return slice_verify(s);
 }