summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-03-04 09:33:12 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-03-04 09:33:12 +0100
commitdbf2801f5ac4dea3834508fd96a2e0f1803f91ff (patch)
tree1f30e06ecd0f12962af55efa05976e9fd26098de
parentdd0395b5654c52e982adf6d354db9c7fdcf4b6c7 (diff)
downloadsystemd-dbf2801f5ac4dea3834508fd96a2e0f1803f91ff.tar.gz
systemctl: do not print items twice in list-dependencies
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1807485.
-rw-r--r--src/systemctl/systemctl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index f44db4ffc3..e02677d541 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -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;