summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorLance Poore <linuxsociety@gmail.com>2017-04-28 07:44:55 -0400
committerPatrick Griffis <tingping@tingping.se>2017-04-28 07:44:55 -0400
commit92496b183e48a067e89e4a48944526cf278b852a (patch)
tree319a68507bb44663e8efab555049b93a5dff1b1c
parent88cb0c9d205552ba3f2531d0d6380f7d9f15c4f7 (diff)
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.
-rw-r--r--plugins/sysinfo/unix/parse.c26
1 files 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)