int r;
r = bus_map_all_properties(bus, "org.freedesktop.login1", path, map, &i);
- if (r < 0) {
- log_error("Could not get properties: %s", strerror(-r));
- return r;
- }
+ if (r < 0)
+ return log_error_errno(r, "Could not get properties: %m");
if (*new_line)
printf("\n");
printf("\t Seat: %s", i.seat);
if (i.vtnr > 0)
- printf("; vc%i", i.vtnr);
+ printf("; vc%u", i.vtnr);
printf("\n");
}
r = bus_map_all_properties(bus, "org.freedesktop.login1", path, map, &i);
if (r < 0) {
- log_error("Could not get properties: %s", strerror(-r));
+ log_error_errno(r, "Could not get properties: %m");
goto finish;
}
r = bus_map_all_properties(bus, "org.freedesktop.login1", path, map, &i);
if (r < 0) {
- log_error("Could not get properties: %s", strerror(-r));
+ log_error_errno(r, "Could not get properties: %m");
goto finish;
}
r = bus_print_all_properties(bus, "org.freedesktop.login1", path, arg_property, arg_all);
if (r < 0)
- log_error("Could not get properties: %s", strerror(-r));
+ log_error_errno(r, "Could not get properties: %m");
return r;
}
uid_t uid;
r = get_user_creds((const char**) (args+i), &uid, NULL, NULL, NULL);
- if (r < 0) {
- log_error("Failed to look up user %s: %s", args[i], strerror(-r));
- return r;
- }
+ if (r < 0)
+ return log_error_errno(r, "Failed to look up user %s: %m", args[i]);
r = sd_bus_call_method(
bus,
uid_t uid;
r = get_user_creds((const char**) (args+i), &uid, NULL, NULL, NULL);
- if (r < 0) {
- log_error("Failed to look up user %s: %s", args[i], strerror(-r));
- return r;
- }
+ if (r < 0)
+ return log_error_errno(r, "Failed to look up user %s: %m", args[i]);
r = sd_bus_call_method (
bus,
uid_t uid;
r = get_user_creds((const char**) (args+i), &uid, NULL, NULL, NULL);
- if (r < 0) {
- log_error("Failed to look up user %s: %s", args[i], strerror(-r));
- return r;
- }
+ if (r < 0)
+ return log_error_errno(r, "Failed to look up user %s: %m", args[i]);
r = sd_bus_call_method (
bus,
uid_t uid;
r = get_user_creds((const char**) (args+i), &uid, NULL, NULL, NULL);
- if (r < 0) {
- log_error("Failed to look up user %s: %s", args[i], strerror(-r));
- return r;
- }
+ if (r < 0)
+ return log_error_errno(r, "Failed to look up user %s: %m", args[i]);
r = sd_bus_call_method (
bus,
}
int main(int argc, char *argv[]) {
- _cleanup_bus_unref_ sd_bus *bus = NULL;
+ _cleanup_bus_close_unref_ sd_bus *bus = NULL;
int r;
setlocale(LC_ALL, "");
r = bus_open_transport(arg_transport, arg_host, false, &bus);
if (r < 0) {
- log_error("Failed to create bus connection: %s", strerror(-r));
+ log_error_errno(r, "Failed to create bus connection: %m");
goto finish;
}