diff options
author | jamesbond <jamesbond> | 2014-07-28 17:01:25 +0000 |
---|---|---|
committer | Leandro Pereira <leandro@hardinfo.org> | 2015-10-25 15:49:33 -0200 |
commit | 6dd14fed6db519a2feb77a5b2b6e73ff03c4d043 (patch) | |
tree | a6784731925626be94d6ae0da328c30a8f0c4b53 /modules/computer | |
parent | da77fa093e35ca15d3b405c41b30f3cbbbe66c26 (diff) |
revert commit [d5afcb6851]; fix the real cause of missing RAM display (use moreinfo_lookup rather than hi_more_info); fix usb display crashing (util.c now looks for lsusb in /usr/sbin first); fix glibc version not showing (glibc located in /lib64/libc.so.6); initial support for DDR3 spd-decoding (incomplete, the manufacturer is not shown yet).
Diffstat (limited to 'modules/computer')
-rw-r--r-- | modules/computer/os.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/modules/computer/os.c b/modules/computer/os.c index 39d0e020..41f8cb3a 100644 --- a/modules/computer/os.c +++ b/modules/computer/os.c @@ -26,14 +26,22 @@ get_libc_version(void) { FILE *libc; gchar buf[256], *tmp, *p; + char *libc_paths[] = { + "/lib/ld-uClibc.so.0", "/lib64/ld-uClibc.so.0", + "/lib/libc.so.6", "/lib64/libc.so.6" + }; + int i; + + for (i=0; i < 4; i++) { + if (g_file_test(libc_paths[i], G_FILE_TEST_EXISTS)) break; + } + switch (i) { + case 0: case 1: return g_strdup("uClibc Library"); + case 2: case 3: break; // gnu libc, continue processing + default: goto err; + } - if (g_file_test("/lib/ld-uClibc.so.0", G_FILE_TEST_EXISTS)) { - return g_strdup("uClibc Library"); - } else if (!g_file_test("/lib/libc.so.6", G_FILE_TEST_EXISTS)) { - goto err; - } - - libc = popen("/lib/libc.so.6", "r"); + libc = popen(libc_paths[i], "r"); if (!libc) goto err; (void)fgets(buf, 256, libc); |