core: remove ManagerRunningAs enum
Previously, we had two enums ManagerRunningAs and UnitFileScope, that were mostly identical and converted from one to the other all the time. The latter had one more value UNIT_FILE_GLOBAL however. Let's simplify things, and remove ManagerRunningAs and replace it by UnitFileScope everywhere, thus making the translation unnecessary. Introduce two new macros MANAGER_IS_SYSTEM() and MANAGER_IS_USER() to simplify checking if we are running in one or the user context.
This commit is contained in:
+2
-2
@@ -109,7 +109,7 @@ static int timer_add_default_dependencies(Timer *t) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (UNIT(t)->manager->running_as == MANAGER_SYSTEM) {
|
||||
if (MANAGER_IS_SYSTEM(UNIT(t)->manager)) {
|
||||
r = unit_add_two_dependencies_by_name(UNIT(t), UNIT_AFTER, UNIT_REQUIRES, SPECIAL_SYSINIT_TARGET, NULL, true);
|
||||
if (r < 0)
|
||||
return r;
|
||||
@@ -135,7 +135,7 @@ static int timer_setup_persistent(Timer *t) {
|
||||
if (!t->persistent)
|
||||
return 0;
|
||||
|
||||
if (UNIT(t)->manager->running_as == MANAGER_SYSTEM) {
|
||||
if (MANAGER_IS_SYSTEM(UNIT(t)->manager)) {
|
||||
|
||||
r = unit_require_mounts_for(UNIT(t), "/var/lib/systemd/timers");
|
||||
if (r < 0)
|
||||
|
||||
Reference in New Issue
Block a user