summaryrefslogtreecommitdiff
path: root/src/systemctl/systemctl-edit.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-03-10 09:47:10 +0100
committerLennart Poettering <lennart@poettering.net>2023-03-10 09:47:39 +0100
commit4870133bfaaf97189a970a29bf47e0e38fa721aa (patch)
treed2fa9a5699a8b4c948179afabf3da2f9da322ce5 /src/systemctl/systemctl-edit.c
parent5f64d2bf332371bdfdcb91b588e57d4c0c20428f (diff)
downloadsystemd-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-edit.c')
-rw-r--r--src/systemctl/systemctl-edit.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/systemctl/systemctl-edit.c b/src/systemctl/systemctl-edit.c
index df01667920..c07112b764 100644
--- a/src/systemctl/systemctl-edit.c
+++ b/src/systemctl/systemctl-edit.c
@@ -37,7 +37,7 @@ int verb_cat(int argc, char *argv[], void *userdata) {
if (arg_transport != BUS_TRANSPORT_LOCAL)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Cannot remotely cat units.");
- r = lookup_paths_init_or_warn(&lp, arg_scope, 0, arg_root);
+ r = lookup_paths_init_or_warn(&lp, arg_runtime_scope, 0, arg_root);
if (r < 0)
return r;
@@ -99,7 +99,7 @@ int verb_cat(int argc, char *argv[], void *userdata) {
ansi_highlight_red(),
ansi_highlight_red(),
ansi_highlight_red(),
- arg_scope == LOOKUP_SCOPE_SYSTEM ? "" : " --user",
+ arg_runtime_scope == RUNTIME_SCOPE_SYSTEM ? "" : " --user",
ansi_normal());
r = cat_files(fragment_path, dropin_paths, 0);
@@ -452,7 +452,7 @@ static int find_paths_to_edit(
if (!suffix)
return log_oom();
- r = lookup_paths_init(&lp, arg_scope, 0, arg_root);
+ r = lookup_paths_init(&lp, arg_runtime_scope, 0, arg_root);
if (r < 0)
return r;
@@ -478,8 +478,8 @@ static int find_paths_to_edit(
if (!path) {
if (!arg_force) {
log_info("Run 'systemctl edit%s --force --full %s' to create a new unit.",
- arg_scope == LOOKUP_SCOPE_GLOBAL ? " --global" :
- arg_scope == LOOKUP_SCOPE_USER ? " --user" : "",
+ arg_runtime_scope == RUNTIME_SCOPE_GLOBAL ? " --global" :
+ arg_runtime_scope == RUNTIME_SCOPE_USER ? " --user" : "",
*name);
return -ENOENT;
}
@@ -595,7 +595,7 @@ int verb_edit(int argc, char *argv[], void *userdata) {
if (arg_transport != BUS_TRANSPORT_LOCAL)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Cannot edit units remotely.");
- r = lookup_paths_init_or_warn(&lp, arg_scope, 0, arg_root);
+ r = lookup_paths_init_or_warn(&lp, arg_runtime_scope, 0, arg_root);
if (r < 0)
return r;