diff options
author | Burt P <pburt0@gmail.com> | 2018-10-01 17:31:58 -0500 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2018-11-04 15:02:12 -0800 |
commit | 3d61921be280fab9b4a5740a8f20a65d4bd2a4cf (patch) | |
tree | c1a2b4cc3e1f43525c018b70d6fcff0d9ac28fbf /modules/devices.c | |
parent | 98047b942cd0f6edf4691ed2ba1f3cece8cbe9c7 (diff) |
devices: Remove product-version from string returned by getMotherboard()
This reverts a change 2db563687071c099851c59396bdde29a00dba156.
It seems to me that using product version in this way gives
inconsistent values.
The recent benchmark result submitted demonstrates the problem:
`2.0 / X370 SLI PLUS (MS-7A33) (Micro-Star International Co., Ltd.)`
The product version `2.0` is put in front, but without the product
name or product vendor for context, it doesn't really add anything.
The board vendor, which otherwise would be in front, is now in () at
the end.
When the product version is not defined, then the motherboard is
reported as `<board vendor> <board name>`. The only time it is
`<board name> (<board vendor>)` is when product version is defined.
If this change is applied, that same motherboard would be reported
`Micro-Star International Co., Ltd. X370 SLI PLUS (MS-7A33)`
which, to me, makes more sense for getMotherboard(). I have no idea
what "product" this is version 2.0 of.
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'modules/devices.c')
-rw-r--r-- | modules/devices.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/modules/devices.c b/modules/devices.c index 1bcf2f1f..ad5c641d 100644 --- a/modules/devices.c +++ b/modules/devices.c @@ -355,7 +355,7 @@ gchar *get_memory_total(void) gchar *get_motherboard(void) { - char *board_name, *board_vendor, *system_version; + char *board_name, *board_vendor; char *ret; #if defined(ARCH_x86) || defined(ARCH_x86_64) @@ -369,11 +369,7 @@ gchar *get_motherboard(void) if (board_vendor == NULL) board_vendor = dmi_get_str("system-manufacturer"); - system_version = dmi_get_str("system-version"); - - if (board_name && board_vendor && system_version) - ret = g_strdup_printf("%s / %s (%s)", system_version, board_name, board_vendor); - else if (board_name && board_vendor) + if (board_name && board_vendor) ret = g_strconcat(board_vendor, " ", board_name, NULL); else if (board_name) ret = g_strdup(board_name); @@ -384,7 +380,6 @@ gchar *get_motherboard(void) free(board_name); free(board_vendor); - free(system_version); return ret; #endif |