manager: move various fields that declare unit defaults into a new structure UnitDefaults

This adds a new structure UnitDefaults which embedds the various default
settings for units we maintain. We so far maintained two sets of
variables for this, one in main.c as static variables and one in the
Manager structure. This moves them into a common structure.

This is most just search/replace, i.e. very dumb refactoring.

The fact that we now use a common structure for this allows us further
refactorings later.

Inspired by the discussions on #27890
This commit is contained in:
Lennart Poettering
2023-09-08 14:19:45 +02:00
parent b8f18c3089
commit c9e120e06f
16 changed files with 309 additions and 306 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ static void timer_init(Unit *u) {
t->next_elapse_monotonic_or_boottime = USEC_INFINITY;
t->next_elapse_realtime = USEC_INFINITY;
t->accuracy_usec = u->manager->default_timer_accuracy_usec;
t->accuracy_usec = u->manager->defaults.timer_accuracy_usec;
t->remain_after_elapse = true;
}