map,
&info);
if (r < 0) {
- log_error("Could not get properties: %s", strerror(-r));
+ log_error_errno(-r, "Could not get properties: %m");
return r;
}
r = bus_print_all_properties(bus, "org.freedesktop.machine1", 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;
}
r = sd_event_default(&event);
if (r < 0) {
- log_error("Failed to get event loop: %s", strerror(-r));
+ log_error_errno(-r, "Failed to get event loop: %m");
return r;
}
r = sd_bus_attach_event(bus, event, 0);
if (r < 0) {
- log_error("Failed to attach bus to event loop: %s", strerror(-r));
+ log_error_errno(-r, "Failed to attach bus to event loop: %m");
return r;
}
&reply2,
"u");
if (r < 0) {
- log_error("Failed to retrieve PID of leader: %s", strerror(-r));
+ log_error_errno(-r, "Failed to retrieve PID of leader: %m");
return r;
}
master = openpt_in_namespace(leader, O_RDWR|O_NOCTTY|O_CLOEXEC|O_NDELAY);
if (master < 0) {
- log_error("Failed to acquire pseudo tty: %s", strerror(-master));
+ log_error_errno(-master, "Failed to acquire pseudo tty: %m");
return master;
}
r = sd_bus_open_system_container(&container_bus, args[1]);
if (r < 0) {
- log_error("Failed to get container bus: %s", strerror(-r));
+ log_error_errno(-r, "Failed to get container bus: %m");
return r;
}
r = pty_forward_new(event, master, &forward);
if (r < 0) {
- log_error("Failed to create PTY forwarder: %s", strerror(-r));
+ log_error_errno(-r, "Failed to create PTY forwarder: %m");
return r;
}
r = sd_event_loop(event);
if (r < 0) {
- log_error("Failed to run event loop: %s", strerror(-r));
+ log_error_errno(-r, "Failed to run event loop: %m");
return r;
}
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;
}