summaryrefslogtreecommitdiffstats
path: root/src/sleep/sleep.c
diff options
context:
space:
mode:
authorLuca Boccassi <bluca@debian.org>2023-07-09 14:03:44 +0200
committerLuca Boccassi <bluca@debian.org>2023-07-10 12:39:35 +0200
commit03b70f060fa520d0ed7adc3099b9e1b3acafa075 (patch)
treeab55b7f2004a97de2aa08324e398f8f6ba8c1cb4 /src/sleep/sleep.c
parentprocess-util: use clone2 on ia64 (diff)
downloadsystemd-03b70f060fa520d0ed7adc3099b9e1b3acafa075.tar.xz
systemd-03b70f060fa520d0ed7adc3099b9e1b3acafa075.zip
sleep: fix unused variable warning
log_level_ignored is used only inside the ifdef, so declare it there too
Diffstat (limited to '')
-rw-r--r--src/sleep/sleep.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c
index dd860d2858..30e53f3a36 100644
--- a/src/sleep/sleep.c
+++ b/src/sleep/sleep.c
@@ -53,8 +53,7 @@
static SleepOperation arg_operation = _SLEEP_OPERATION_INVALID;
static int write_efi_hibernate_location(const HibernateLocation *hibernate_location, bool required) {
- int log_level = required ? LOG_ERR : LOG_DEBUG,
- log_level_ignore = required ? LOG_WARNING : LOG_DEBUG;
+ int log_level = required ? LOG_ERR : LOG_DEBUG;
#if ENABLE_EFI
_cleanup_(json_variant_unrefp) JsonVariant *v = NULL;
@@ -64,7 +63,7 @@ static int write_efi_hibernate_location(const HibernateLocation *hibernate_locat
const char *uuid_str;
sd_id128_t uuid;
struct utsname uts = {};
- int r;
+ int r, log_level_ignore = required ? LOG_WARNING : LOG_DEBUG;
assert(hibernate_location);
assert(hibernate_location->swap);