else
r = sd_event_add_io(UNIT(n)->manager->event, &n->starter_event_source, n->starter_fd, EPOLLIN, busname_dispatch_io, n);
if (r < 0) {
- log_unit_warning(UNIT(n)->id, "Failed to watch starter fd: %s", strerror(-r));
+ log_unit_warning_errno(UNIT(n)->id, r, "Failed to watch starter fd: %m");
busname_unwatch_fd(n);
return r;
}
mode = UNIT(n)->manager->running_as == SYSTEMD_SYSTEM ? "system" : "user";
n->starter_fd = bus_kernel_open_bus_fd(mode, &path);
- if (n->starter_fd < 0) {
- log_unit_warning(UNIT(n)->id, "Failed to open %s: %s", path ?: "kdbus", strerror(-n->starter_fd));
- return n->starter_fd;
- }
+ if (n->starter_fd < 0)
+ return log_unit_warning_errno(UNIT(n)->id, n->starter_fd, "Failed to open %s: %m", path ?: "kdbus");
return 0;
}
fail_child:
log_open();
- log_error("Failed to create starter connection at step %s: %s", exit_status_to_string(ret, EXIT_STATUS_SYSTEMD), strerror(-r));
+ log_error_errno(r, "Failed to create starter connection at step %s: %m", exit_status_to_string(ret, EXIT_STATUS_SYSTEMD));
_exit(ret);
}
n->control_pid,
false);
if (r < 0) {
- log_unit_warning(UNIT(n)->id, "%s failed to kill control process: %s", UNIT(n)->id, strerror(-r));
+ log_unit_warning_errno(UNIT(n)->id, r, "%s failed to kill control process: %m", UNIT(n)->id);
goto fail;
}
if (r > 0) {
r = busname_arm_timer(n);
if (r < 0) {
- log_unit_warning(UNIT(n)->id, "%s failed to arm timer: %s", UNIT(n)->id, strerror(-r));
+ log_unit_warning_errno(UNIT(n)->id, r, "%s failed to arm timer: %m", UNIT(n)->id);
goto fail;
}
if (n->activating) {
r = busname_watch_fd(n);
if (r < 0) {
- log_unit_warning(UNIT(n)->id, "%s failed to watch names: %s", UNIT(n)->id, strerror(-r));
+ log_unit_warning_errno(UNIT(n)->id, r, "%s failed to watch names: %m", UNIT(n)->id);
goto fail;
}
r = busname_make_starter(n, &n->control_pid);
if (r < 0) {
- log_unit_warning(UNIT(n)->id, "%s failed to fork 'making' task: %s", UNIT(n)->id, strerror(-r));
+ log_unit_warning_errno(UNIT(n)->id, r, "%s failed to fork 'making' task: %m", UNIT(n)->id);
goto fail;
}
r = bus_kernel_make_starter(n->starter_fd, n->name, n->activating, n->accept_fd, NULL, n->policy_world);
if (r < 0) {
- log_unit_warning(UNIT(n)->id, "%s failed to make starter: %s", UNIT(n)->id, strerror(-r));
+ log_unit_warning_errno(UNIT(n)->id, r, "%s failed to make starter: %m", UNIT(n)->id);
goto fail;
}