This allows some strings constants to be deduplicated.
libsystemd-core.so + systemd are about 2k smaller.
Also tweak some messages for consistency. We used 'exec' in one place and
'execute' in all other messages.
return;
execv(SYSTEMCTL_BINARY_PATH, argv);
- log_error_errno(errno, "Failed to exec " SYSTEMCTL_BINARY_PATH ": %m");
+ log_error_errno(errno, "Failed to execute %s: %m", SYSTEMCTL_BINARY_PATH);
exit(EXIT_FAILURE);
#endif
}
/* Fall back to default.target, which we used to always use by default. Only do this if no
* explicit configuration was given. */
- log_info("Falling back to " SPECIAL_DEFAULT_TARGET ".");
+ log_info("Falling back to %s.", SPECIAL_DEFAULT_TARGET);
r = manager_load_startable_unit_or_warn(m, SPECIAL_DEFAULT_TARGET, NULL, &target);
}
if (r < 0) {
- log_info("Falling back to " SPECIAL_RESCUE_TARGET ".");
+ log_info("Falling back to %s.", SPECIAL_RESCUE_TARGET);
r = manager_load_startable_unit_or_warn(m, SPECIAL_RESCUE_TARGET, NULL, &target);
if (r < 0) {
u = manager_get_unit(m, SPECIAL_ROOT_MOUNT);
if (!u) {
r = unit_new_for_name(m, sizeof(Mount), SPECIAL_ROOT_MOUNT, &u);
- if (r < 0) {
- log_error_errno(r, "Failed to allocate the special " SPECIAL_ROOT_MOUNT " unit: %m");
- return;
- }
+ if (r < 0)
+ return (void) log_error_errno(r, "Failed to allocate the special %s unit: %m",
+ SPECIAL_ROOT_MOUNT);
}
u->perpetual = true;
u = manager_get_unit(m, SPECIAL_INIT_SCOPE);
if (!u) {
r = unit_new_for_name(m, sizeof(Scope), SPECIAL_INIT_SCOPE, &u);
- if (r < 0) {
- log_error_errno(r, "Failed to allocate the special " SPECIAL_INIT_SCOPE " unit: %m");
- return;
- }
+ if (r < 0)
+ return (void) log_error_errno(r, "Failed to allocate the special %s unit: %m",
+ SPECIAL_INIT_SCOPE);
}
u->transient = true;
if (s->type == SERVICE_DBUS) {
r = unit_add_dependency_by_name(UNIT(s), UNIT_REQUIRES, SPECIAL_DBUS_SOCKET, true, UNIT_DEPENDENCY_FILE);
if (r < 0)
- return log_unit_error_errno(UNIT(s), r, "Failed to add dependency on " SPECIAL_DBUS_SOCKET ": %m");
+ return log_unit_error_errno(UNIT(s), r, "Failed to add dependency on %s: %m", SPECIAL_DBUS_SOCKET);
/* We always want to be ordered against dbus.socket if both are in the transaction. */
r = unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, SPECIAL_DBUS_SOCKET, true, UNIT_DEPENDENCY_FILE);
if (r < 0)
- return log_unit_error_errno(UNIT(s), r, "Failed to add dependency on " SPECIAL_DBUS_SOCKET ": %m");
+ return log_unit_error_errno(UNIT(s), r, "Failed to add dependency on %s: %m", SPECIAL_DBUS_SOCKET);
}
r = unit_watch_bus_name(UNIT(s), s->bus_name);