if (!m)
return log_oom();
- r = sd_bus_add_match(bus, m, NULL, NULL);
+ r = sd_bus_add_match(bus, NULL, m, NULL, NULL);
if (r < 0) {
log_error("Failed to add match: %s", strerror(-r));
return r;
}
STRV_FOREACH(i, arg_matches) {
- r = sd_bus_add_match(bus, *i, NULL, NULL);
+ r = sd_bus_add_match(bus, NULL, *i, NULL, NULL);
if (r < 0) {
log_error("Failed to add match: %s", strerror(-r));
return r;
}
if (!added_something) {
- r = sd_bus_add_match(bus, "", NULL, NULL);
+ r = sd_bus_add_match(bus, NULL, "", NULL, NULL);
if (r < 0) {
log_error("Failed to add match: %s", strerror(-r));
return r;
}
static int help(void) {
-
printf("%s [OPTIONS...] {COMMAND} ...\n\n"
"Introspect the bus.\n\n"
" -h --help Show this help\n"
" list List bus names\n"
" monitor [SERVICE...] Show bus traffic\n"
" status NAME Show name status\n"
- " help Show this help\n",
- program_invocation_short_name);
+ " help Show this help\n"
+ , program_invocation_short_name);
return 0;
}
assert(argc >= 0);
assert(argv);
- while ((c = getopt_long(argc, argv, "hH:M:", options, NULL)) >= 0) {
+ while ((c = getopt_long(argc, argv, "hH:M:", options, NULL)) >= 0)
switch (c) {
default:
assert_not_reached("Unhandled option");
}
- }
if (!arg_unique && !arg_acquired && !arg_activatable)
arg_unique = arg_acquired = arg_activatable = true;
}
int main(int argc, char *argv[]) {
- _cleanup_bus_unref_ sd_bus *bus = NULL;
+ _cleanup_bus_close_unref_ sd_bus *bus = NULL;
int r;
log_parse_environment();
log_error("Failed to set monitor mode: %s", strerror(-r));
goto finish;
}
+
+ r = sd_bus_negotiate_creds(bus, _SD_BUS_CREDS_ALL);
+ if (r < 0) {
+ log_error("Failed to enable credentials: %s", strerror(-r));
+ goto finish;
+ }
+
+ r = sd_bus_negotiate_timestamp(bus, true);
+ if (r < 0) {
+ log_error("Failed to enable timestamps: %s", strerror(-r));
+ goto finish;
+ }
+
+ r = sd_bus_negotiate_fds(bus, true);
+ if (r < 0) {
+ log_error("Failed to enable fds: %s", strerror(-r));
+ goto finish;
+ }
}
if (arg_address)