]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sleep: fix unused variable warning 28308/head
authorLuca Boccassi <bluca@debian.org>
Sun, 9 Jul 2023 12:03:44 +0000 (13:03 +0100)
committerLuca Boccassi <bluca@debian.org>
Mon, 10 Jul 2023 10:39:35 +0000 (11:39 +0100)
log_level_ignored is used only inside the ifdef, so declare it there too

src/sleep/sleep.c

index dd860d28584f70d0ddaa333c1502a0f2baa399a7..30e53f3a360490466e3f89f817a6a06fa99f2dec 100644 (file)
@@ -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);