From 92496b183e48a067e89e4a48944526cf278b852a Mon Sep 17 00:00:00 2001 From: Lance Poore Date: Fri, 28 Apr 2017 07:44:55 -0400 Subject: [PATCH] sysinfo: Lower priority of make.conf for distro name This is used elsewhere other than Gentoo so it is a rather unreliable check compared to lsb-release. --- plugins/sysinfo/unix/parse.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/plugins/sysinfo/unix/parse.c b/plugins/sysinfo/unix/parse.c index f7419e24..0e4e8877 100644 --- a/plugins/sysinfo/unix/parse.c +++ b/plugins/sysinfo/unix/parse.c @@ -256,19 +256,7 @@ int xs_parse_distro(char *name) FILE *fp = NULL; char buffer[bsize], *pos = NULL; - if((fp = fopen("/etc/portage/make.conf", "r")) != NULL || - (fp = fopen("/etc/make.conf", "r")) != NULL) - { - char keywords[bsize]; - while(fgets(buffer, bsize, fp) != NULL) - find_match_char(buffer, "ACCEPT_KEYWORDS", keywords); - /* cppcheck-suppress uninitvar */ - if (strstr(keywords, "\"") == NULL) - g_snprintf(buffer, bsize, "Gentoo Linux (stable)"); - else - g_snprintf(buffer, bsize, "Gentoo Linux %s", keywords); - } - else if((fp = fopen("/etc/redhat-release", "r")) != NULL) + if((fp = fopen("/etc/redhat-release", "r")) != NULL) fgets(buffer, bsize, fp); else if((fp = fopen("/etc/mageia-release", "r")) != NULL) fgets(buffer, bsize, fp); @@ -302,6 +290,18 @@ int xs_parse_distro(char *name) fgets(release, bsize, fp); g_snprintf(buffer, bsize, "Debian %s", release); } + else if((fp = fopen("/etc/portage/make.conf", "r")) != NULL || + (fp = fopen("/etc/make.conf", "r")) != NULL) + { + char keywords[bsize]; + while(fgets(buffer, bsize, fp) != NULL) + find_match_char(buffer, "ACCEPT_KEYWORDS", keywords); + /* cppcheck-suppress uninitvar */ + if (strstr(keywords, "\"") == NULL) + g_snprintf(buffer, bsize, "Gentoo Linux (stable)"); + else + g_snprintf(buffer, bsize, "Gentoo Linux %s", keywords); + } else g_snprintf(buffer, bsize, "Unknown Distro"); if(fp != NULL)