diff options
author | Burt P <pburt0@gmail.com> | 2017-07-20 22:28:09 -0500 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2017-07-21 05:12:21 -0700 |
commit | 620997880825682ac43eec3e0fcc9c40407dd5c4 (patch) | |
tree | 4823e23f7dc195341e2cfd6d623dc755416e75da | |
parent | ae4934d97fecea3d0a1fd70616e7790d75070e47 (diff) |
computer/os.c: another libc detection fix
Starting in Debian 9, ldconfig requires root, and so it can't be
used to get the GLIBC version. Try `ldd --version` first. It should
give the same results.
Signed-off-by: Burt P <pburt0@gmail.com>
-rw-r--r-- | modules/computer/os.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/modules/computer/os.c b/modules/computer/os.c index 3ea4189e..72cd0b5c 100644 --- a/modules/computer/os.c +++ b/modules/computer/os.c @@ -25,17 +25,19 @@ static gchar * get_libc_version(void) { static const struct { - const char *test_cmd; - const char *match_str; - const char *lib_name; - gboolean try_ver_str; - gboolean use_stderr; + const char *test_cmd; + const char *match_str; + const char *lib_name; + gboolean try_ver_str; + gboolean use_stderr; } libs[] = { - { "ldconfig -V", "GLIBC", N_("GNU C Library"), TRUE, FALSE}, - { "ldconfig -V", "GNU libc", N_("GNU C Library"), TRUE, FALSE}, - { "ldconfig -v", "uClibc", N_("uClibc or uClibc-ng"), FALSE, FALSE}, - { "diet", "diet version", N_("diet libc"), TRUE, TRUE}, - { } + { "ldd --version", "GLIBC", N_("GNU C Library"), TRUE, FALSE}, + { "ldd --version", "GNU libc", N_("GNU C Library"), TRUE, FALSE}, + { "ldconfig -V", "GLIBC", N_("GNU C Library"), TRUE, FALSE}, + { "ldconfig -V", "GNU libc", N_("GNU C Library"), TRUE, FALSE}, + { "ldconfig -v", "uClibc", N_("uClibc or uClibc-ng"), FALSE, FALSE}, + { "diet", "diet version", N_("diet libc"), TRUE, TRUE}, + { NULL } }; int i; |