mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09:00
pid1: drop now-unused path parameter to add_dependency_by_name()
This commit is contained in:
@@ -1572,7 +1572,7 @@ static int bus_unit_set_transient_property(
|
||||
if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
|
||||
_cleanup_free_ char *label = NULL;
|
||||
|
||||
r = unit_add_dependency_by_name(u, d, other, NULL, true, UNIT_DEPENDENCY_FILE);
|
||||
r = unit_add_dependency_by_name(u, d, other, true, UNIT_DEPENDENCY_FILE);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -380,7 +380,7 @@ static int device_add_udev_wants(Unit *u, sd_device *dev) {
|
||||
return log_unit_error_errno(u, r, "Failed to mangle unit name \"%s\": %m", word);
|
||||
}
|
||||
|
||||
r = unit_add_dependency_by_name(u, UNIT_WANTS, k, NULL, true, UNIT_DEPENDENCY_UDEV);
|
||||
r = unit_add_dependency_by_name(u, UNIT_WANTS, k, true, UNIT_DEPENDENCY_UDEV);
|
||||
if (r < 0)
|
||||
return log_unit_error_errno(u, r, "Failed to add Wants= dependency: %m");
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ static int process_deps(Unit *u, UnitDependency dependency, const char *dir_suff
|
||||
log_unit_warning(u, "%s dependency dropin %s target %s has different name",
|
||||
unit_dependency_to_string(dependency), *p, target);
|
||||
|
||||
r = unit_add_dependency_by_name(u, dependency, entry, NULL, true, UNIT_DEPENDENCY_FILE);
|
||||
r = unit_add_dependency_by_name(u, dependency, entry, true, UNIT_DEPENDENCY_FILE);
|
||||
if (r < 0)
|
||||
log_unit_warning_errno(u, r, "Cannot add %s dependency on %s, ignoring: %m",
|
||||
unit_dependency_to_string(dependency), entry);
|
||||
|
||||
@@ -135,7 +135,7 @@ int config_parse_unit_deps(
|
||||
continue;
|
||||
}
|
||||
|
||||
r = unit_add_dependency_by_name(u, d, k, NULL, true, UNIT_DEPENDENCY_FILE);
|
||||
r = unit_add_dependency_by_name(u, d, k, true, UNIT_DEPENDENCY_FILE);
|
||||
if (r < 0)
|
||||
log_syntax(unit, LOG_ERR, filename, line, r, "Failed to add dependency on %s, ignoring: %m", k);
|
||||
}
|
||||
@@ -1770,7 +1770,7 @@ int config_parse_service_sockets(
|
||||
if (r < 0)
|
||||
log_syntax(unit, LOG_ERR, filename, line, r, "Failed to add dependency on %s, ignoring: %m", k);
|
||||
|
||||
r = unit_add_dependency_by_name(UNIT(s), UNIT_TRIGGERED_BY, k, NULL, true, UNIT_DEPENDENCY_FILE);
|
||||
r = unit_add_dependency_by_name(UNIT(s), UNIT_TRIGGERED_BY, k, true, UNIT_DEPENDENCY_FILE);
|
||||
if (r < 0)
|
||||
log_syntax(unit, LOG_ERR, filename, line, r, "Failed to add dependency on %s, ignoring: %m", k);
|
||||
}
|
||||
|
||||
@@ -456,7 +456,7 @@ static int mount_add_default_dependencies(Mount *m) {
|
||||
* network.target, so that they are shut down only
|
||||
* after this mount unit is stopped. */
|
||||
|
||||
r = unit_add_dependency_by_name(UNIT(m), UNIT_AFTER, SPECIAL_NETWORK_TARGET, NULL, true, mask);
|
||||
r = unit_add_dependency_by_name(UNIT(m), UNIT_AFTER, SPECIAL_NETWORK_TARGET, true, mask);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -475,7 +475,7 @@ static int mount_add_default_dependencies(Mount *m) {
|
||||
} else
|
||||
after = SPECIAL_LOCAL_FS_PRE_TARGET;
|
||||
|
||||
r = unit_add_dependency_by_name(UNIT(m), UNIT_AFTER, after, NULL, true, mask);
|
||||
r = unit_add_dependency_by_name(UNIT(m), UNIT_AFTER, after, true, mask);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -485,7 +485,7 @@ static int mount_add_default_dependencies(Mount *m) {
|
||||
|
||||
/* If this is a tmpfs mount then we have to unmount it before we try to deactivate swaps */
|
||||
if (streq_ptr(p->fstype, "tmpfs")) {
|
||||
r = unit_add_dependency_by_name(UNIT(m), UNIT_AFTER, SPECIAL_SWAP_TARGET, NULL, true, mask);
|
||||
r = unit_add_dependency_by_name(UNIT(m), UNIT_AFTER, SPECIAL_SWAP_TARGET, true, mask);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
@@ -1436,11 +1436,11 @@ static int mount_setup_new_unit(
|
||||
int r;
|
||||
|
||||
target = mount_is_network(p) ? SPECIAL_REMOTE_FS_TARGET : SPECIAL_LOCAL_FS_TARGET;
|
||||
r = unit_add_dependency_by_name(u, UNIT_BEFORE, target, NULL, true, UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT);
|
||||
r = unit_add_dependency_by_name(u, UNIT_BEFORE, target, true, UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = unit_add_dependency_by_name(u, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true, UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT);
|
||||
r = unit_add_dependency_by_name(u, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, true, UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
@@ -1498,7 +1498,7 @@ static int mount_setup_existing_unit(
|
||||
* in the dependency "Set*" objects who created a
|
||||
* dependency), we can only add deps, never lose them,
|
||||
* until the next full daemon-reload. */
|
||||
unit_add_dependency_by_name(u, UNIT_BEFORE, SPECIAL_REMOTE_FS_TARGET, NULL, true, UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT);
|
||||
unit_add_dependency_by_name(u, UNIT_BEFORE, SPECIAL_REMOTE_FS_TARGET, true, UNIT_DEPENDENCY_MOUNTINFO_IMPLICIT);
|
||||
load_extras = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -298,7 +298,7 @@ static int path_add_default_dependencies(Path *p) {
|
||||
if (!UNIT(p)->default_dependencies)
|
||||
return 0;
|
||||
|
||||
r = unit_add_dependency_by_name(UNIT(p), UNIT_BEFORE, SPECIAL_PATHS_TARGET, NULL, true, UNIT_DEPENDENCY_DEFAULT);
|
||||
r = unit_add_dependency_by_name(UNIT(p), UNIT_BEFORE, SPECIAL_PATHS_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -617,7 +617,7 @@ static int service_add_default_dependencies(Service *s) {
|
||||
/* In the --user instance there's no sysinit.target,
|
||||
* in that case require basic.target instead. */
|
||||
|
||||
r = unit_add_dependency_by_name(UNIT(s), UNIT_REQUIRES, SPECIAL_BASIC_TARGET, NULL, true, UNIT_DEPENDENCY_DEFAULT);
|
||||
r = unit_add_dependency_by_name(UNIT(s), UNIT_REQUIRES, SPECIAL_BASIC_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
@@ -625,7 +625,7 @@ static int service_add_default_dependencies(Service *s) {
|
||||
/* Second, if the rest of the base system is in the same
|
||||
* transaction, order us after it, but do not pull it in or
|
||||
* even require it. */
|
||||
r = unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, SPECIAL_BASIC_TARGET, NULL, true, UNIT_DEPENDENCY_DEFAULT);
|
||||
r = unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, SPECIAL_BASIC_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -661,12 +661,12 @@ static int service_setup_bus_name(Service *s) {
|
||||
if (!s->bus_name)
|
||||
return 0;
|
||||
|
||||
r = unit_add_dependency_by_name(UNIT(s), UNIT_REQUIRES, SPECIAL_DBUS_SOCKET, NULL, true, UNIT_DEPENDENCY_FILE);
|
||||
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");
|
||||
|
||||
/* 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, NULL, true, UNIT_DEPENDENCY_FILE);
|
||||
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");
|
||||
|
||||
|
||||
@@ -301,7 +301,7 @@ static int socket_add_default_dependencies(Socket *s) {
|
||||
if (!UNIT(s)->default_dependencies)
|
||||
return 0;
|
||||
|
||||
r = unit_add_dependency_by_name(UNIT(s), UNIT_BEFORE, SPECIAL_SOCKETS_TARGET, NULL, true, UNIT_DEPENDENCY_DEFAULT);
|
||||
r = unit_add_dependency_by_name(UNIT(s), UNIT_BEFORE, SPECIAL_SOCKETS_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ static int swap_add_device_dependencies(Swap *s) {
|
||||
/* File based swap devices need to be ordered after
|
||||
* systemd-remount-fs.service, since they might need a
|
||||
* writable file system. */
|
||||
return unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, SPECIAL_REMOUNT_FS_SERVICE, NULL, true, UNIT_DEPENDENCY_FILE);
|
||||
return unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, SPECIAL_REMOUNT_FS_SERVICE, true, UNIT_DEPENDENCY_FILE);
|
||||
}
|
||||
|
||||
static int swap_add_default_dependencies(Swap *s) {
|
||||
@@ -216,7 +216,7 @@ static int swap_add_default_dependencies(Swap *s) {
|
||||
|
||||
/* swap units generated for the swap dev links are missing the
|
||||
* ordering dep against the swap target. */
|
||||
r = unit_add_dependency_by_name(UNIT(s), UNIT_BEFORE, SPECIAL_SWAP_TARGET, NULL, true, UNIT_DEPENDENCY_DEFAULT);
|
||||
r = unit_add_dependency_by_name(UNIT(s), UNIT_BEFORE, SPECIAL_SWAP_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ static int timer_add_default_dependencies(Timer *t) {
|
||||
if (!UNIT(t)->default_dependencies)
|
||||
return 0;
|
||||
|
||||
r = unit_add_dependency_by_name(UNIT(t), UNIT_BEFORE, SPECIAL_TIMERS_TARGET, NULL, true, UNIT_DEPENDENCY_DEFAULT);
|
||||
r = unit_add_dependency_by_name(UNIT(t), UNIT_BEFORE, SPECIAL_TIMERS_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -99,7 +99,7 @@ static int timer_add_default_dependencies(Timer *t) {
|
||||
|
||||
LIST_FOREACH(value, v, t->values) {
|
||||
if (v->base == TIMER_CALENDAR) {
|
||||
r = unit_add_dependency_by_name(UNIT(t), UNIT_AFTER, SPECIAL_TIME_SYNC_TARGET, NULL, true, UNIT_DEPENDENCY_DEFAULT);
|
||||
r = unit_add_dependency_by_name(UNIT(t), UNIT_AFTER, SPECIAL_TIME_SYNC_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
|
||||
if (r < 0)
|
||||
return r;
|
||||
break;
|
||||
|
||||
@@ -1009,7 +1009,7 @@ int unit_add_exec_dependencies(Unit *u, ExecContext *c) {
|
||||
return r;
|
||||
}
|
||||
|
||||
r = unit_add_dependency_by_name(u, UNIT_AFTER, SPECIAL_TMPFILES_SETUP_SERVICE, NULL, true, UNIT_DEPENDENCY_FILE);
|
||||
r = unit_add_dependency_by_name(u, UNIT_AFTER, SPECIAL_TMPFILES_SETUP_SERVICE, true, UNIT_DEPENDENCY_FILE);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
@@ -1027,7 +1027,7 @@ int unit_add_exec_dependencies(Unit *u, ExecContext *c) {
|
||||
/* If syslog or kernel logging is requested, make sure our own
|
||||
* logging daemon is run first. */
|
||||
|
||||
r = unit_add_dependency_by_name(u, UNIT_AFTER, SPECIAL_JOURNALD_SOCKET, NULL, true, UNIT_DEPENDENCY_FILE);
|
||||
r = unit_add_dependency_by_name(u, UNIT_AFTER, SPECIAL_JOURNALD_SOCKET, true, UNIT_DEPENDENCY_FILE);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -2929,19 +2929,19 @@ static int resolve_template(Unit *u, const char *name, const char*path, char **b
|
||||
return 0;
|
||||
}
|
||||
|
||||
int unit_add_dependency_by_name(Unit *u, UnitDependency d, const char *name, const char *path, bool add_reference, UnitDependencyMask mask) {
|
||||
int unit_add_dependency_by_name(Unit *u, UnitDependency d, const char *name, bool add_reference, UnitDependencyMask mask) {
|
||||
_cleanup_free_ char *buf = NULL;
|
||||
Unit *other;
|
||||
int r;
|
||||
|
||||
assert(u);
|
||||
assert(name || path);
|
||||
assert(name);
|
||||
|
||||
r = resolve_template(u, name, path, &buf, &name);
|
||||
r = resolve_template(u, name, NULL, &buf, &name);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = manager_load_unit(u->manager, name, path, NULL, &other);
|
||||
r = manager_load_unit(u->manager, name, NULL, NULL, &other);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -602,7 +602,7 @@ int unit_add_name(Unit *u, const char *name);
|
||||
int unit_add_dependency(Unit *u, UnitDependency d, Unit *other, bool add_reference, UnitDependencyMask mask);
|
||||
int unit_add_two_dependencies(Unit *u, UnitDependency d, UnitDependency e, Unit *other, bool add_reference, UnitDependencyMask mask);
|
||||
|
||||
int unit_add_dependency_by_name(Unit *u, UnitDependency d, const char *name, const char *filename, bool add_reference, UnitDependencyMask mask);
|
||||
int unit_add_dependency_by_name(Unit *u, UnitDependency d, const char *name, bool add_reference, UnitDependencyMask mask);
|
||||
int unit_add_two_dependencies_by_name(Unit *u, UnitDependency d, UnitDependency e, const char *name, const char *path, bool add_reference, UnitDependencyMask mask);
|
||||
|
||||
int unit_add_exec_dependencies(Unit *u, ExecContext *c);
|
||||
|
||||
Reference in New Issue
Block a user