From 6dd14fed6db519a2feb77a5b2b6e73ff03c4d043 Mon Sep 17 00:00:00 2001 From: jamesbond Date: Mon, 28 Jul 2014 17:01:25 +0000 Subject: 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). --- modules/computer/os.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'modules/computer/os.c') 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); -- cgit v1.2.3