summaryrefslogtreecommitdiff
path: root/src/core/manager.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-02-24 21:24:23 +0100
committerLennart Poettering <lennart@poettering.net>2016-04-12 13:43:30 +0200
commit463d0d15690c7abe2172a23ae23c5547693dd71f (patch)
treedd3410341fefada4758bf935ee1db9f680620ebf /src/core/manager.h
parentc51932be73e9cfc96e7bcaea1b31347133e1f3ed (diff)
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.
Diffstat (limited to 'src/core/manager.h')
-rw-r--r--src/core/manager.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/manager.h b/src/core/manager.h
index 5471bd7a0d..19eab958ea 100644
--- a/src/core/manager.h
+++ b/src/core/manager.h
@@ -140,6 +140,7 @@ struct Manager {
sd_event_source *jobs_in_progress_event_source;
+ UnitFileScope unit_file_scope;
LookupPaths lookup_paths;
Set *unit_path_cache;
@@ -224,7 +225,6 @@ struct Manager {
unsigned n_in_gc_queue;
/* Flags */
- ManagerRunningAs running_as;
ManagerExitCode exit_code:5;
bool dispatching_load_queue:1;
@@ -300,10 +300,13 @@ struct Manager {
const char *unit_log_field;
const char *unit_log_format_string;
- int first_boot;
+ int first_boot; /* tri-state */
};
-int manager_new(ManagerRunningAs running_as, bool test_run, Manager **m);
+#define MANAGER_IS_SYSTEM(m) ((m)->unit_file_scope == UNIT_FILE_SYSTEM)
+#define MANAGER_IS_USER(m) ((m)->unit_file_scope != UNIT_FILE_SYSTEM)
+
+int manager_new(UnitFileScope scope, bool test_run, Manager **m);
Manager* manager_free(Manager *m);
void manager_enumerate(Manager *m);