diff options
Diffstat (limited to 'hardinfo2/dmi_util.c')
-rw-r--r-- | hardinfo2/dmi_util.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/hardinfo2/dmi_util.c b/hardinfo2/dmi_util.c index 35f9282f..82681820 100644 --- a/hardinfo2/dmi_util.c +++ b/hardinfo2/dmi_util.c @@ -310,8 +310,18 @@ char *dmidecode_read(const dmi_type *type) { snprintf(full_path, PATH_MAX, "dmidecode"); } - spawned = hardinfo_spawn_command_line_sync(full_path, - &out, &err, &i, NULL); + spawned = hardinfo_spawn_command_line_sync(full_path, &out, &err, &i, NULL); + + if (!spawned) { + if(type) { + snprintf(full_path, PATH_MAX, "/sbin/dmidecode -t %"PRId32, *type); + } else { + snprintf(full_path, PATH_MAX, "/sbin/dmidecode"); + } + spawned = hardinfo_spawn_command_line_sync(full_path, &out, &err, &i, NULL); + } + + if (spawned) { if (i == 0) ret = out; |