From: Yu Watanabe Date: Mon, 22 Aug 2022 04:36:54 +0000 (+0900) Subject: hostname: make chassis type actually obtained from ACPI when nothing from DMI X-Git-Tag: v252-rc1~387^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=471fdebfdea843648acb5abeacf5ae559c3ad77a;p=thirdparty%2Fsystemd.git hostname: make chassis type actually obtained from ACPI when nothing from DMI Fixes a bug introduced by 8c8b1800e90d4307397300ef32b0f6d95efad057. Fixes #24384. --- diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index 5f09e6d0eb5..8c0b63503fa 100644 --- a/src/hostname/hostnamed.c +++ b/src/hostname/hostnamed.c @@ -415,7 +415,7 @@ static char* context_get_chassis(Context *c) { if (!isempty(c->data[PROP_CHASSIS])) return strdup(c->data[PROP_CHASSIS]); - if (get_dmi_data("ID_CHASSIS", NULL, &dmi) >= 0) + if (get_dmi_data("ID_CHASSIS", NULL, &dmi) > 0) return dmi; fallback = fallback_chassis();