diff options
author | Ondrej Čerman <ondrej.cerman@gmail.com> | 2021-09-11 23:18:11 +0200 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2021-09-15 10:07:20 -0700 |
commit | 5cf1f86da14dc9ea8033744af09c8c8d35608369 (patch) | |
tree | 6d7feb89ee3ed18f0277c215bc81aac625e35c71 | |
parent | 84a3445010d908a0d0a0195496dedbc6eb3aa9d4 (diff) |
devices/dmi: Added no value state for chassis-type.
-rw-r--r-- | modules/devices/dmi.c | 5 |
1 files changed, 4 insertions, 1 deletions
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: |