]> git.pld-linux.org Git - packages/systemd.git/blob - hostnamed-errno.patch
286721dc57fc756b8f94f03831c9d319fbbcc54f
[packages/systemd.git] / hostnamed-errno.patch
1 From 4b5e7c3eaa0ccf5f438d1793fe07daaf59bc73f6 Mon Sep 17 00:00:00 2001
2 From: Jan Palus <jpalus@fastmail.com>
3 Date: Thu, 8 Jul 2021 00:23:21 +0200
4 Subject: [PATCH] hostnamed: correct variable with errno in fallback_chassis
5
6 fixes assertion failure on arm:
7
8 systemd-hostnamed[642]: Assertion '(_error) != 0' failed at src/hostname/hostnamed.c:207, function fallback_chassis(). Aborting.
9 ---
10  src/hostname/hostnamed.c | 8 ++++----
11  1 file changed, 4 insertions(+), 4 deletions(-)
12
13 diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
14 index bd535ddc4d..36702f2fb0 100644
15 --- a/src/hostname/hostnamed.c
16 +++ b/src/hostname/hostnamed.c
17 @@ -204,14 +204,14 @@ static const char* fallback_chassis(void) {
18  
19          r = read_one_line_file("/sys/class/dmi/id/chassis_type", &type);
20          if (r < 0) {
21 -                log_debug_errno(v, "Failed to read DMI chassis type, ignoring: %m");
22 +                log_debug_errno(r, "Failed to read DMI chassis type, ignoring: %m");
23                  goto try_acpi;
24          }
25  
26          r = safe_atou(type, &t);
27          free(type);
28          if (r < 0) {
29 -                log_debug_errno(v, "Failed to parse DMI chassis type, ignoring: %m");
30 +                log_debug_errno(r, "Failed to parse DMI chassis type, ignoring: %m");
31                  goto try_acpi;
32          }
33  
34 @@ -260,14 +260,14 @@ static const char* fallback_chassis(void) {
35  try_acpi:
36          r = read_one_line_file("/sys/firmware/acpi/pm_profile", &type);
37          if (r < 0) {
38 -                log_debug_errno(v, "Failed read ACPI PM profile, ignoring: %m");
39 +                log_debug_errno(r, "Failed read ACPI PM profile, ignoring: %m");
40                  return NULL;
41          }
42  
43          r = safe_atou(type, &t);
44          free(type);
45          if (r < 0) {
46 -                log_debug_errno(v, "Failed parse ACPI PM profile, ignoring: %m");
47 +                log_debug_errno(r, "Failed parse ACPI PM profile, ignoring: %m");
48                  return NULL;
49          }
50  
51 -- 
52 2.32.0
53
This page took 0.042921 seconds and 2 git commands to generate.