]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: do not print items twice in list-dependencies
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 4 Mar 2020 08:33:12 +0000 (09:33 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 4 Mar 2020 08:33:12 +0000 (09:33 +0100)
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1807485.

src/systemctl/systemctl.c

index f44db4ffc30d1fa1238228c5c65e2e58435fe6f2..e02677d54168e5a21a4c7c5bb3a0582bbe33c4ac 100644 (file)
@@ -785,6 +785,8 @@ static int list_dependencies_get_dependencies(sd_bus *bus, const char *name, cha
         if (r < 0)
                 return log_error_errno(r, "Failed to get properties of %s: %s", name, bus_error_message(&error, r));
 
+        strv_uniq(deps); /* Sometimes a unit might have multiple deps on the other unit,
+                          * but we still want to show it just once. */
         *ret = TAKE_PTR(deps);
 
         return 0;