summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/busctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd/sd-bus/busctl.c')
-rw-r--r--src/libsystemd/sd-bus/busctl.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/libsystemd/sd-bus/busctl.c b/src/libsystemd/sd-bus/busctl.c
index 9a6d338231..5d07d5809c 100644
--- a/src/libsystemd/sd-bus/busctl.c
+++ b/src/libsystemd/sd-bus/busctl.c
@@ -449,7 +449,7 @@ static int tree(sd_bus *bus, char **argv) {
if (not_first)
printf("\n");
- printf("Service %s%s%s:\n", ansi_highlight(), *i, ansi_highlight_off());
+ printf("Service %s%s%s:\n", ansi_highlight(), *i, ansi_normal());
q = tree_one(bus, *i, NULL, true);
if (q < 0 && r >= 0)
@@ -466,7 +466,7 @@ static int tree(sd_bus *bus, char **argv) {
if (argv[2]) {
pager_open_if_enabled();
- printf("Service %s%s%s:\n", ansi_highlight(), *i, ansi_highlight_off());
+ printf("Service %s%s%s:\n", ansi_highlight(), *i, ansi_normal());
}
q = tree_one(bus, *i, NULL, !!argv[2]);
@@ -1052,7 +1052,7 @@ static int introspect(sd_bus *bus, char **argv) {
is_interface ? ansi_highlight() : "",
is_interface ? "" : ".",
- !is_interface + (int) name_width, strdash(streq_ptr(m->type, "interface") ? m->interface : m->name),
- is_interface ? ansi_highlight_off() : "",
+ is_interface ? ansi_normal() : "",
(int) type_width, strdash(m->type),
(int) signature_width, strdash(m->signature),
(int) result_width, rv,
@@ -1096,6 +1096,15 @@ static int monitor(sd_bus *bus, char *argv[], int (*dump)(sd_bus_message *m, FIL
if (r < 0)
return log_error_errno(r, "Failed to add match: %m");
+ free(m);
+ m = strjoin("destination='", *i, "'", NULL);
+ if (!m)
+ return log_oom();
+
+ r = sd_bus_add_match(bus, NULL, m, NULL, NULL);
+ if (r < 0)
+ return log_error_errno(r, "Failed to add match: %m");
+
added_something = true;
}
@@ -1196,15 +1205,15 @@ static int status(sd_bus *bus, char *argv[]) {
r = sd_bus_get_address(bus, &address);
if (r >= 0)
- printf("BusAddress=%s%s%s\n", ansi_highlight(), address, ansi_highlight_off());
+ printf("BusAddress=%s%s%s\n", ansi_highlight(), address, ansi_normal());
r = sd_bus_get_scope(bus, &scope);
if (r >= 0)
- printf("BusScope=%s%s%s\n", ansi_highlight(), scope, ansi_highlight_off());
+ printf("BusScope=%s%s%s\n", ansi_highlight(), scope, ansi_normal());
r = sd_bus_get_bus_id(bus, &bus_id);
if (r >= 0)
- printf("BusID=%s" SD_ID128_FORMAT_STR "%s\n", ansi_highlight(), SD_ID128_FORMAT_VAL(bus_id), ansi_highlight_off());
+ printf("BusID=%s" SD_ID128_FORMAT_STR "%s\n", ansi_highlight(), SD_ID128_FORMAT_VAL(bus_id), ansi_normal());
r = sd_bus_get_owner_creds(
bus,