diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-03-10 09:47:10 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2023-03-10 09:47:39 +0100 |
commit | 4870133bfaaf97189a970a29bf47e0e38fa721aa (patch) | |
tree | d2fa9a5699a8b4c948179afabf3da2f9da322ce5 /src/systemctl/systemctl.c | |
parent | 5f64d2bf332371bdfdcb91b588e57d4c0c20428f (diff) | |
download | systemd-4870133bfaaf97189a970a29bf47e0e38fa721aa.tar.gz |
basic: add RuntimeScope enum
In various tools and services we have a per-system and per-user concept.
So far we sometimes used a boolean indicating whether we are in system
mode, or a reversed boolean indicating whether we are in user mode, or
the LookupScope enum used by the lookup path logic.
Let's address that, in introduce a common enum for this, we can use all
across the board.
This is mostly just search/replace, no actual code changes.
Diffstat (limited to 'src/systemctl/systemctl.c')
-rw-r--r-- | src/systemctl/systemctl.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 0155036572..862edada08 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -71,7 +71,7 @@ char **arg_properties = NULL; bool arg_all = false; enum dependency arg_dependency = DEPENDENCY_FORWARD; const char *_arg_job_mode = NULL; -LookupScope arg_scope = LOOKUP_SCOPE_SYSTEM; +RuntimeScope arg_runtime_scope = RUNTIME_SCOPE_SYSTEM; bool arg_wait = false; bool arg_no_block = false; int arg_legend = -1; /* -1: true, unless --quiet is passed, 1: true */ @@ -646,15 +646,15 @@ static int systemctl_parse_argv(int argc, char *argv[]) { break; case ARG_USER: - arg_scope = LOOKUP_SCOPE_USER; + arg_runtime_scope = RUNTIME_SCOPE_USER; break; case ARG_SYSTEM: - arg_scope = LOOKUP_SCOPE_SYSTEM; + arg_runtime_scope = RUNTIME_SCOPE_SYSTEM; break; case ARG_GLOBAL: - arg_scope = LOOKUP_SCOPE_GLOBAL; + arg_runtime_scope = RUNTIME_SCOPE_GLOBAL; break; case ARG_WAIT: @@ -992,10 +992,10 @@ static int systemctl_parse_argv(int argc, char *argv[]) { /* If we are in --user mode, there's no point in talking to PolicyKit or the infra to query system * passwords */ - if (arg_scope != LOOKUP_SCOPE_SYSTEM) + if (arg_runtime_scope != RUNTIME_SCOPE_SYSTEM) arg_ask_password = false; - if (arg_transport == BUS_TRANSPORT_REMOTE && arg_scope != LOOKUP_SCOPE_SYSTEM) + if (arg_transport == BUS_TRANSPORT_REMOTE && arg_runtime_scope != RUNTIME_SCOPE_SYSTEM) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Cannot access user instance remotely."); |