map,
&info);
if (r < 0) {
- log_error("Failed to query server: %s", strerror(-r));
+ log_error_errno(r, "Failed to query server: %m");
goto fail;
}
assert(n == 1);
r = get_timezones(&zones);
- if (r < 0) {
- log_error("Failed to read list of time zones: %s", strerror(-r));
- return r;
- }
+ if (r < 0)
+ return log_error_errno(r, "Failed to read list of time zones: %m");
pager_open_if_enabled();
strv_print(zones);
break;
case 'M':
- arg_transport = BUS_TRANSPORT_CONTAINER;
+ arg_transport = BUS_TRANSPORT_MACHINE;
arg_host = optarg;
break;
}
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;
}