]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
hostnamed: correct variable with errno in fallback_chassis
authorJan Palus <jpalus@fastmail.com>
Wed, 7 Jul 2021 22:23:21 +0000 (00:23 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 20 Jul 2021 16:00:59 +0000 (18:00 +0200)
fixes assertion failure on arm:

systemd-hostnamed[642]: Assertion '(_error) != 0' failed at src/hostname/hostnamed.c:207, function fallback_chassis(). Aborting.

(cherry picked from commit 105a4245ff13d588e1e848e8ee3cffd6185bd0ae)
(cherry picked from commit 4a44597bdd725f504ebd520b0deef7797dc46daa)

src/hostname/hostnamed.c

index a1794bdab1e36a9715dfec29b3b16063b1fc7c42..82cef660ad9dc27b950412bbefb1a25f56e498b4 100644 (file)
@@ -198,14 +198,14 @@ static const char* fallback_chassis(void) {
 
         r = read_one_line_file("/sys/class/dmi/id/chassis_type", &type);
         if (r < 0) {
-                log_debug_errno(v, "Failed to read DMI chassis type, ignoring: %m");
+                log_debug_errno(r, "Failed to read DMI chassis type, ignoring: %m");
                 goto try_acpi;
         }
 
         r = safe_atou(type, &t);
         free(type);
         if (r < 0) {
-                log_debug_errno(v, "Failed to parse DMI chassis type, ignoring: %m");
+                log_debug_errno(r, "Failed to parse DMI chassis type, ignoring: %m");
                 goto try_acpi;
         }
 
@@ -254,14 +254,14 @@ static const char* fallback_chassis(void) {
 try_acpi:
         r = read_one_line_file("/sys/firmware/acpi/pm_profile", &type);
         if (r < 0) {
-                log_debug_errno(v, "Failed read ACPI PM profile, ignoring: %m");
+                log_debug_errno(r, "Failed read ACPI PM profile, ignoring: %m");
                 return NULL;
         }
 
         r = safe_atou(type, &t);
         free(type);
         if (r < 0) {
-                log_debug_errno(v, "Failed parse ACPI PM profile, ignoring: %m");
+                log_debug_errno(r, "Failed parse ACPI PM profile, ignoring: %m");
                 return NULL;
         }