summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-03-01 13:03:31 +0100
committerLuca Boccassi <bluca@debian.org>2022-03-10 15:51:28 +0100
commitfb1381662b61ae5aa87925964e4eb7805db54d47 (patch)
treea261317f1fa9947c1894f9ea2b992f71dcfbad70 /src
parentTEST-68: enhance testing of chained commands (diff)
downloadsystemd-fb1381662b61ae5aa87925964e4eb7805db54d47.tar.xz
systemd-fb1381662b61ae5aa87925964e4eb7805db54d47.zip
various: align vertically for ease of reading
Diffstat (limited to 'src')
-rw-r--r--src/core/service.c2
-rw-r--r--src/core/unit.c60
-rw-r--r--src/test/test-engine.c38
3 files changed, 50 insertions, 50 deletions
diff --git a/src/core/service.c b/src/core/service.c
index 551f3df355..b71c26ca33 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -4641,7 +4641,7 @@ static const char* const service_type_table[_SERVICE_TYPE_MAX] = {
DEFINE_STRING_TABLE_LOOKUP(service_type, ServiceType);
static const char* const service_exit_type_table[_SERVICE_EXIT_TYPE_MAX] = {
- [SERVICE_EXIT_MAIN] = "main",
+ [SERVICE_EXIT_MAIN] = "main",
[SERVICE_EXIT_CGROUP] = "cgroup",
};
diff --git a/src/core/unit.c b/src/core/unit.c
index af6cf097fc..a164a9d305 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -3009,37 +3009,37 @@ int unit_add_dependency(
UnitDependencyMask mask) {
static const UnitDependency inverse_table[_UNIT_DEPENDENCY_MAX] = {
- [UNIT_REQUIRES] = UNIT_REQUIRED_BY,
- [UNIT_REQUISITE] = UNIT_REQUISITE_OF,
- [UNIT_WANTS] = UNIT_WANTED_BY,
- [UNIT_BINDS_TO] = UNIT_BOUND_BY,
- [UNIT_PART_OF] = UNIT_CONSISTS_OF,
- [UNIT_UPHOLDS] = UNIT_UPHELD_BY,
- [UNIT_REQUIRED_BY] = UNIT_REQUIRES,
- [UNIT_REQUISITE_OF] = UNIT_REQUISITE,
- [UNIT_WANTED_BY] = UNIT_WANTS,
- [UNIT_BOUND_BY] = UNIT_BINDS_TO,
- [UNIT_CONSISTS_OF] = UNIT_PART_OF,
- [UNIT_UPHELD_BY] = UNIT_UPHOLDS,
- [UNIT_CONFLICTS] = UNIT_CONFLICTED_BY,
- [UNIT_CONFLICTED_BY] = UNIT_CONFLICTS,
- [UNIT_BEFORE] = UNIT_AFTER,
- [UNIT_AFTER] = UNIT_BEFORE,
- [UNIT_ON_SUCCESS] = UNIT_ON_SUCCESS_OF,
- [UNIT_ON_SUCCESS_OF] = UNIT_ON_SUCCESS,
- [UNIT_ON_FAILURE] = UNIT_ON_FAILURE_OF,
- [UNIT_ON_FAILURE_OF] = UNIT_ON_FAILURE,
- [UNIT_TRIGGERS] = UNIT_TRIGGERED_BY,
- [UNIT_TRIGGERED_BY] = UNIT_TRIGGERS,
- [UNIT_PROPAGATES_RELOAD_TO] = UNIT_RELOAD_PROPAGATED_FROM,
+ [UNIT_REQUIRES] = UNIT_REQUIRED_BY,
+ [UNIT_REQUISITE] = UNIT_REQUISITE_OF,
+ [UNIT_WANTS] = UNIT_WANTED_BY,
+ [UNIT_BINDS_TO] = UNIT_BOUND_BY,
+ [UNIT_PART_OF] = UNIT_CONSISTS_OF,
+ [UNIT_UPHOLDS] = UNIT_UPHELD_BY,
+ [UNIT_REQUIRED_BY] = UNIT_REQUIRES,
+ [UNIT_REQUISITE_OF] = UNIT_REQUISITE,
+ [UNIT_WANTED_BY] = UNIT_WANTS,
+ [UNIT_BOUND_BY] = UNIT_BINDS_TO,
+ [UNIT_CONSISTS_OF] = UNIT_PART_OF,
+ [UNIT_UPHELD_BY] = UNIT_UPHOLDS,
+ [UNIT_CONFLICTS] = UNIT_CONFLICTED_BY,
+ [UNIT_CONFLICTED_BY] = UNIT_CONFLICTS,
+ [UNIT_BEFORE] = UNIT_AFTER,
+ [UNIT_AFTER] = UNIT_BEFORE,
+ [UNIT_ON_SUCCESS] = UNIT_ON_SUCCESS_OF,
+ [UNIT_ON_SUCCESS_OF] = UNIT_ON_SUCCESS,
+ [UNIT_ON_FAILURE] = UNIT_ON_FAILURE_OF,
+ [UNIT_ON_FAILURE_OF] = UNIT_ON_FAILURE,
+ [UNIT_TRIGGERS] = UNIT_TRIGGERED_BY,
+ [UNIT_TRIGGERED_BY] = UNIT_TRIGGERS,
+ [UNIT_PROPAGATES_RELOAD_TO] = UNIT_RELOAD_PROPAGATED_FROM,
[UNIT_RELOAD_PROPAGATED_FROM] = UNIT_PROPAGATES_RELOAD_TO,
- [UNIT_PROPAGATES_STOP_TO] = UNIT_STOP_PROPAGATED_FROM,
- [UNIT_STOP_PROPAGATED_FROM] = UNIT_PROPAGATES_STOP_TO,
- [UNIT_JOINS_NAMESPACE_OF] = UNIT_JOINS_NAMESPACE_OF, /* symmetric! 👓 */
- [UNIT_REFERENCES] = UNIT_REFERENCED_BY,
- [UNIT_REFERENCED_BY] = UNIT_REFERENCES,
- [UNIT_IN_SLICE] = UNIT_SLICE_OF,
- [UNIT_SLICE_OF] = UNIT_IN_SLICE,
+ [UNIT_PROPAGATES_STOP_TO] = UNIT_STOP_PROPAGATED_FROM,
+ [UNIT_STOP_PROPAGATED_FROM] = UNIT_PROPAGATES_STOP_TO,
+ [UNIT_JOINS_NAMESPACE_OF] = UNIT_JOINS_NAMESPACE_OF, /* symmetric! 👓 */
+ [UNIT_REFERENCES] = UNIT_REFERENCED_BY,
+ [UNIT_REFERENCED_BY] = UNIT_REFERENCES,
+ [UNIT_IN_SLICE] = UNIT_SLICE_OF,
+ [UNIT_SLICE_OF] = UNIT_IN_SLICE,
};
Unit *original_u = u, *original_other = other;
UnitDependencyAtom a;
diff --git a/src/test/test-engine.c b/src/test/test-engine.c
index 473e896acc..cd01d1358b 100644
--- a/src/test/test-engine.c
+++ b/src/test/test-engine.c
@@ -192,17 +192,17 @@ int main(int argc, char *argv[]) {
assert_se(unit_add_dependency(a, UNIT_PROPAGATES_RELOAD_TO, b, true, UNIT_DEPENDENCY_UDEV) == 0);
assert_se(unit_add_dependency(a, UNIT_PROPAGATES_RELOAD_TO, c, true, UNIT_DEPENDENCY_PROC_SWAP) == 0);
- assert_se(hashmap_get(unit_get_dependencies(a, UNIT_PROPAGATES_RELOAD_TO), b));
- assert_se(hashmap_get(unit_get_dependencies(b, UNIT_RELOAD_PROPAGATED_FROM), a));
- assert_se(hashmap_get(unit_get_dependencies(a, UNIT_PROPAGATES_RELOAD_TO), c));
- assert_se(hashmap_get(unit_get_dependencies(c, UNIT_RELOAD_PROPAGATED_FROM), a));
+ assert_se( hashmap_get(unit_get_dependencies(a, UNIT_PROPAGATES_RELOAD_TO), b));
+ assert_se( hashmap_get(unit_get_dependencies(b, UNIT_RELOAD_PROPAGATED_FROM), a));
+ assert_se( hashmap_get(unit_get_dependencies(a, UNIT_PROPAGATES_RELOAD_TO), c));
+ assert_se( hashmap_get(unit_get_dependencies(c, UNIT_RELOAD_PROPAGATED_FROM), a));
unit_remove_dependencies(a, UNIT_DEPENDENCY_UDEV);
assert_se(!hashmap_get(unit_get_dependencies(a, UNIT_PROPAGATES_RELOAD_TO), b));
assert_se(!hashmap_get(unit_get_dependencies(b, UNIT_RELOAD_PROPAGATED_FROM), a));
- assert_se(hashmap_get(unit_get_dependencies(a, UNIT_PROPAGATES_RELOAD_TO), c));
- assert_se(hashmap_get(unit_get_dependencies(c, UNIT_RELOAD_PROPAGATED_FROM), a));
+ assert_se( hashmap_get(unit_get_dependencies(a, UNIT_PROPAGATES_RELOAD_TO), c));
+ assert_se( hashmap_get(unit_get_dependencies(c, UNIT_RELOAD_PROPAGATED_FROM), a));
unit_remove_dependencies(a, UNIT_DEPENDENCY_PROC_SWAP);
@@ -232,15 +232,15 @@ int main(int argc, char *argv[]) {
log_info("/* Dump of merged a+stub */");
unit_dump(a, stderr, NULL);
- assert_se(unit_has_dependency(a, UNIT_ATOM_AFTER, manager_get_unit(m, SPECIAL_BASIC_TARGET)));
- assert_se(unit_has_dependency(a, UNIT_ATOM_AFTER, manager_get_unit(m, "quux.target")));
- assert_se(unit_has_dependency(a, UNIT_ATOM_AFTER, manager_get_unit(m, SPECIAL_ROOT_SLICE)));
- assert_se(unit_has_dependency(a, UNIT_ATOM_PULL_IN_START, manager_get_unit(m, "non-existing.mount")));
- assert_se(unit_has_dependency(a, UNIT_ATOM_RETROACTIVE_START_REPLACE, manager_get_unit(m, "non-existing.mount")));
- assert_se(unit_has_dependency(a, UNIT_ATOM_ON_FAILURE, manager_get_unit(m, "non-existing-on-failure.target")));
- assert_se(unit_has_dependency(manager_get_unit(m, "non-existing-on-failure.target"), UNIT_ATOM_ON_FAILURE_OF, a));
- assert_se(unit_has_dependency(a, UNIT_ATOM_ON_SUCCESS, manager_get_unit(m, "non-existing-on-success.target")));
- assert_se(unit_has_dependency(manager_get_unit(m, "non-existing-on-success.target"), UNIT_ATOM_ON_SUCCESS_OF, a));
+ assert_se( unit_has_dependency(a, UNIT_ATOM_AFTER, manager_get_unit(m, SPECIAL_BASIC_TARGET)));
+ assert_se( unit_has_dependency(a, UNIT_ATOM_AFTER, manager_get_unit(m, "quux.target")));
+ assert_se( unit_has_dependency(a, UNIT_ATOM_AFTER, manager_get_unit(m, SPECIAL_ROOT_SLICE)));
+ assert_se( unit_has_dependency(a, UNIT_ATOM_PULL_IN_START, manager_get_unit(m, "non-existing.mount")));
+ assert_se( unit_has_dependency(a, UNIT_ATOM_RETROACTIVE_START_REPLACE, manager_get_unit(m, "non-existing.mount")));
+ assert_se( unit_has_dependency(a, UNIT_ATOM_ON_FAILURE, manager_get_unit(m, "non-existing-on-failure.target")));
+ assert_se( unit_has_dependency(manager_get_unit(m, "non-existing-on-failure.target"), UNIT_ATOM_ON_FAILURE_OF, a));
+ assert_se( unit_has_dependency(a, UNIT_ATOM_ON_SUCCESS, manager_get_unit(m, "non-existing-on-success.target")));
+ assert_se( unit_has_dependency(manager_get_unit(m, "non-existing-on-success.target"), UNIT_ATOM_ON_SUCCESS_OF, a));
assert_se(!unit_has_dependency(a, UNIT_ATOM_ON_FAILURE, manager_get_unit(m, "basic.target")));
assert_se(!unit_has_dependency(a, UNIT_ATOM_ON_SUCCESS, manager_get_unit(m, "basic.target")));
assert_se(!unit_has_dependency(a, UNIT_ATOM_ON_FAILURE_OF, manager_get_unit(m, "basic.target")));
@@ -282,19 +282,19 @@ int main(int argc, char *argv[]) {
assert_se(UNIT_GET_SLICE(tomato) == zupa);
assert_se(!unit_has_dependency(tomato, UNIT_ATOM_IN_SLICE, sauce));
assert_se(!unit_has_dependency(tomato, UNIT_ATOM_IN_SLICE, fruit));
- assert_se(unit_has_dependency(tomato, UNIT_ATOM_IN_SLICE, zupa));
+ assert_se( unit_has_dependency(tomato, UNIT_ATOM_IN_SLICE, zupa));
assert_se(!unit_has_dependency(tomato, UNIT_ATOM_REFERENCES, sauce));
assert_se(!unit_has_dependency(tomato, UNIT_ATOM_REFERENCES, fruit));
- assert_se(unit_has_dependency(tomato, UNIT_ATOM_REFERENCES, zupa));
+ assert_se( unit_has_dependency(tomato, UNIT_ATOM_REFERENCES, zupa));
assert_se(!unit_has_dependency(sauce, UNIT_ATOM_SLICE_OF, tomato));
assert_se(!unit_has_dependency(fruit, UNIT_ATOM_SLICE_OF, tomato));
- assert_se(unit_has_dependency(zupa, UNIT_ATOM_SLICE_OF, tomato));
+ assert_se( unit_has_dependency(zupa, UNIT_ATOM_SLICE_OF, tomato));
assert_se(!unit_has_dependency(sauce, UNIT_ATOM_REFERENCED_BY, tomato));
assert_se(!unit_has_dependency(fruit, UNIT_ATOM_REFERENCED_BY, tomato));
- assert_se(unit_has_dependency(zupa, UNIT_ATOM_REFERENCED_BY, tomato));
+ assert_se( unit_has_dependency(zupa, UNIT_ATOM_REFERENCED_BY, tomato));
return 0;
}