summaryrefslogtreecommitdiff
path: root/src/shared/bus-polkit.c
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2022-04-23 15:53:29 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-04-24 01:31:05 +0900
commitd5a99b7c9c65ab7651c51de4db81d34cfd51f143 (patch)
tree3c6a5d69adbae595793833bc8f29bd7f66501317 /src/shared/bus-polkit.c
parent5662811e34a4c553ec4c5684d66061192427a1b3 (diff)
downloadsystemd-d5a99b7c9c65ab7651c51de4db81d34cfd51f143.tar.gz
tree-wide: Simplify variable declarations behind #ifdef
Diffstat (limited to 'src/shared/bus-polkit.c')
-rw-r--r--src/shared/bus-polkit.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/shared/bus-polkit.c b/src/shared/bus-polkit.c
index 4d733a8173..6ad6c08b23 100644
--- a/src/shared/bus-polkit.c
+++ b/src/shared/bus-polkit.c
@@ -258,11 +258,6 @@ int bus_verify_polkit_async(
Hashmap **registry,
sd_bus_error *ret_error) {
-#if ENABLE_POLKIT
- _cleanup_(sd_bus_message_unrefp) sd_bus_message *pk = NULL;
- AsyncPolkitQuery *q;
- int c;
-#endif
const char *sender;
int r;
@@ -275,7 +270,7 @@ int bus_verify_polkit_async(
return r;
#if ENABLE_POLKIT
- q = hashmap_get(*registry, call);
+ AsyncPolkitQuery *q = hashmap_get(*registry, call);
if (q) {
int authorized, challenge;
@@ -331,7 +326,9 @@ int bus_verify_polkit_async(
return -EBADMSG;
#if ENABLE_POLKIT
- c = sd_bus_message_get_allow_interactive_authorization(call);
+ _cleanup_(sd_bus_message_unrefp) sd_bus_message *pk = NULL;
+
+ int c = sd_bus_message_get_allow_interactive_authorization(call);
if (c < 0)
return c;
if (c > 0)