commit:     9cb1e202e281d9fa3ebbf9f354b0672d98743d87
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Thu Jul  8 20:22:01 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Thu Jul  8 20:22:01 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9cb1e202

sys-apps/systemd: backport fix for hostnamed

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 .../files/249-hostnamed-error-variable.patch       | 50 ++++++++++++++++++++++
 .../{systemd-249.ebuild => systemd-249-r1.ebuild}  |  1 +
 2 files changed, 51 insertions(+)

diff --git a/sys-apps/systemd/files/249-hostnamed-error-variable.patch 
b/sys-apps/systemd/files/249-hostnamed-error-variable.patch
new file mode 100644
index 00000000000..7fe7af73a00
--- /dev/null
+++ b/sys-apps/systemd/files/249-hostnamed-error-variable.patch
@@ -0,0 +1,50 @@
+From 105a4245ff13d588e1e848e8ee3cffd6185bd0ae Mon Sep 17 00:00:00 2001
+From: Jan Palus <[email protected]>
+Date: Thu, 8 Jul 2021 00:23:21 +0200
+Subject: [PATCH] hostnamed: correct variable with errno in fallback_chassis
+
+fixes assertion failure on arm:
+
+systemd-hostnamed[642]: Assertion '(_error) != 0' failed at 
src/hostname/hostnamed.c:207, function fallback_chassis(). Aborting.
+---
+ src/hostname/hostnamed.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
+index bd535ddc4d80..36702f2fb0cd 100644
+--- a/src/hostname/hostnamed.c
++++ b/src/hostname/hostnamed.c
+@@ -204,14 +204,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;
+         }
+ 
+@@ -260,14 +260,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;
+         }
+ 

diff --git a/sys-apps/systemd/systemd-249.ebuild 
b/sys-apps/systemd/systemd-249-r1.ebuild
similarity index 99%
rename from sys-apps/systemd/systemd-249.ebuild
rename to sys-apps/systemd/systemd-249-r1.ebuild
index 7b82142e7ac..3bc38914353 100644
--- a/sys-apps/systemd/systemd-249.ebuild
+++ b/sys-apps/systemd/systemd-249-r1.ebuild
@@ -218,6 +218,7 @@ src_prepare() {
 
        # Add local patches here
        PATCHES+=(
+               "${FILESDIR}/249-hostnamed-error-variable.patch"
        )
 
        if ! use vanilla; then

Reply via email to