From 5cf1f86da14dc9ea8033744af09c8c8d35608369 Mon Sep 17 00:00:00 2001 From: Ondrej Čerman Date: Sat, 11 Sep 2021 23:18:11 +0200 Subject: devices/dmi: Added no value state for chassis-type. --- modules/devices/dmi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modules/devices') diff --git a/modules/devices/dmi.c b/modules/devices/dmi.c index c5cad3e8..45b5e76b 100644 --- a/modules/devices/dmi.c +++ b/modules/devices/dmi.c @@ -90,8 +90,11 @@ gboolean dmi_get_info(void) } else if (group && info->id_str) { int state = 3; - if (strcmp(info->id_str, "chassis-type") == 0) + if (strcmp(info->id_str, "chassis-type") == 0) { value = dmi_chassis_type_str(-1, 1); + if (value == NULL) + state = (getuid() == 0) ? 0 : 1; + } else { switch (dmi_str_status(info->id_str)) { case 0: -- cgit v1.2.3