From af88bc0bffc1b33a92aa662b9d8f9c0e81479602 Mon Sep 17 00:00:00 2001 From: Kim Holviala Date: Wed, 30 Dec 2015 11:50:08 +0200 Subject: [PATCH] Added detection for Gentoo Linux version --- platform.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/platform.c b/platform.c index 52b0efd..c2df811 100644 --- a/platform.c +++ b/platform.c @@ -152,6 +152,16 @@ void platform(state *st) } } + /* Identify Gentoo */ + if (!*sysname && (fp = fopen("/etc/gentoo-release", "r"))) { + fgets(sysname, sizeof(sysname), fp); + fclose(fp); + + if ((c = strstr(sysname, "release "))) sstrlcpy(release, c + 8); + if ((c = strchr(release, ' '))) *c = '\0'; + if ((c = strchr(sysname, ' '))) *c = '\0'; + } + /* Identify RedHat */ if (!*sysname && (fp = fopen("/etc/redhat-release", "r"))) { fgets(sysname, sizeof(sysname), fp); @@ -159,8 +169,8 @@ void platform(state *st) if ((c = strstr(sysname, "release "))) sstrlcpy(release, c + 8); if ((c = strchr(release, ' '))) *c = '\0'; - if ((c = strchr(sysname, ' '))) *c = '\0'; + if (strcmp(sysname, "Red") == MATCH) sstrlcpy(sysname, "RedHat"); }