chiark / gitweb /
systemctl: load unit if necessary
[elogind.git] / unit.c
diff --git a/unit.c b/unit.c
index 5c19b3b2da32626b5da0ce15a7850db35e723420..b69b6e36201a6cb218bff5c3d51e95c68293cf28 100644 (file)
--- a/unit.c
+++ b/unit.c
@@ -125,6 +125,11 @@ int unit_add_name(Unit *u, const char *text) {
                 goto fail;
         }
 
+        if (hashmap_size(u->meta.manager->units) >= MANAGER_MAX_NAMES) {
+                r = -E2BIG;
+                goto fail;
+        }
+
         if ((r = set_put(u->meta.names, s)) < 0) {
                 if (r == -EEXIST)
                         r = 0;
@@ -563,7 +568,7 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) {
         prefix2 = p2 ? p2 : prefix;
 
         fprintf(f,
-                "%s Unit %s:\n"
+                "%s-> Unit %s:\n"
                 "%s\tDescription: %s\n"
                 "%s\tInstance: %s\n"
                 "%s\tUnit Load State: %s\n"