summaryrefslogtreecommitdiff
path: root/src/stdio-bridge
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/stdio-bridge
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/stdio-bridge')
-rw-r--r--src/stdio-bridge/stdio-bridge.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/stdio-bridge/stdio-bridge.c b/src/stdio-bridge/stdio-bridge.c
index 6e8f2bbe3c..1b2c00734a 100644
--- a/src/stdio-bridge/stdio-bridge.c
+++ b/src/stdio-bridge/stdio-bridge.c
@@ -23,7 +23,7 @@
static const char *arg_bus_path = DEFAULT_BUS_PATH;
static BusTransport arg_transport = BUS_TRANSPORT_LOCAL;
-static bool arg_user = false;
+static RuntimeScope arg_runtime_scope = RUNTIME_SCOPE_SYSTEM;
static int help(void) {
printf("%s [OPTIONS...]\n\n"
@@ -73,11 +73,11 @@ static int parse_argv(int argc, char *argv[]) {
return version();
case ARG_USER:
- arg_user = true;
+ arg_runtime_scope = RUNTIME_SCOPE_USER;
break;
case ARG_SYSTEM:
- arg_user = false;
+ arg_runtime_scope = RUNTIME_SCOPE_SYSTEM;
break;
case 'p':
@@ -133,7 +133,7 @@ static int run(int argc, char *argv[]) {
return log_error_errno(r, "Failed to allocate bus: %m");
if (arg_transport == BUS_TRANSPORT_MACHINE)
- r = bus_set_address_machine(a, arg_user, arg_bus_path);
+ r = bus_set_address_machine(a, arg_runtime_scope, arg_bus_path);
else
r = sd_bus_set_address(a, arg_bus_path);
if (r < 0)