static void pager_open_if_enabled(void) {
- /* Cache result before we open the pager */
if (arg_no_pager)
return;
if (!arg_ask_password)
return;
- polkit_agent_open();
-}
+ if (arg_transport != BUS_TRANSPORT_LOCAL)
+ return;
-static int log_parse_error(int r) {
- log_error("Failed to parse message: %s", strerror(-r));
- return r;
+ polkit_agent_open();
}
static int list_sessions(sd_bus *bus, char **args, unsigned n) {
r = sd_bus_message_enter_container(reply, 'a', "(susso)");
if (r < 0)
- return log_parse_error(r);
+ return bus_log_parse_error(r);
printf("%10s %10s %-16s %-16s\n", "SESSION", "UID", "USER", "SEAT");
k++;
}
if (r < 0)
- return log_parse_error(r);
+ return bus_log_parse_error(r);
printf("\n%u sessions listed.\n", k);
r = sd_bus_message_enter_container(reply, 'a', "(uso)");
if (r < 0)
- return log_parse_error(r);
+ return bus_log_parse_error(r);
printf("%10s %-16s\n", "UID", "USER");
k++;
}
if (r < 0)
- return log_parse_error(r);
+ return bus_log_parse_error(r);
printf("\n%u users listed.\n", k);
r = sd_bus_message_enter_container(reply, 'a', "(so)");
if (r < 0)
- return log_parse_error(r);
+ return bus_log_parse_error(r);
printf("%-16s\n", "SEAT");
k++;
}
if (r < 0)
- return log_parse_error(r);
+ return bus_log_parse_error(r);
printf("\n%u seats listed.\n", k);
uid_t uid;
const char *name;
usec_t timestamp;
- int vtnr;
+ unsigned int vtnr;
const char *seat;
const char *tty;
const char *display;
{}
};
- SessionStatusInfo i = {};
char since1[FORMAT_TIMESTAMP_RELATIVE_MAX], *s1;
char since2[FORMAT_TIMESTAMP_MAX], *s2;
+ SessionStatusInfo i = {};
int r;
r = bus_map_all_properties(bus, "org.freedesktop.login1", path, map, &i);
static const struct bus_properties_map map[] = {
{ "Id", "s", NULL, offsetof(SeatStatusInfo, id) },
- { "ActiveSession", "(so)", &prop_map_first_of_struct, offsetof(SeatStatusInfo, active_session) },
- { "Sessions", "a(so)", &prop_map_sessions_strv, offsetof(SeatStatusInfo, sessions) },
+ { "ActiveSession", "(so)", prop_map_first_of_struct, offsetof(SeatStatusInfo, active_session) },
+ { "Sessions", "a(so)", prop_map_sessions_strv, offsetof(SeatStatusInfo, sessions) },
{}
};
r = sd_bus_message_read(reply, "o", &path);
if (r < 0)
- return log_parse_error(r);
+ return bus_log_parse_error(r);
if (show_properties)
r = bus_print_all_properties(bus, "org.freedesktop.login1", path, NULL, arg_all);
r = sd_bus_message_read(reply, "o", &path);
if (r < 0)
- return log_parse_error(r);
+ return bus_log_parse_error(r);
if (show_properties)
r = bus_print_all_properties(bus, "org.freedesktop.login1", path, NULL, arg_all);
r = sd_bus_message_read(reply, "o", &path);
if (r < 0)
- return log_parse_error(r);
+ return bus_log_parse_error(r);
if (show_properties)
r = bus_print_all_properties(bus, "org.freedesktop.login1", path, NULL, arg_all);