1
0
mirror of https://github.com/gophernicus/gophernicus.git synced 2024-12-04 14:46:37 -05:00

Added detection for Gentoo Linux version

This commit is contained in:
Kim Holviala 2015-12-30 11:50:08 +02:00
parent c77c0dd87d
commit af88bc0bff

View File

@ -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 */ /* Identify RedHat */
if (!*sysname && (fp = fopen("/etc/redhat-release", "r"))) { if (!*sysname && (fp = fopen("/etc/redhat-release", "r"))) {
fgets(sysname, sizeof(sysname), fp); fgets(sysname, sizeof(sysname), fp);
@ -159,8 +169,8 @@ void platform(state *st)
if ((c = strstr(sysname, "release "))) sstrlcpy(release, c + 8); if ((c = strstr(sysname, "release "))) sstrlcpy(release, c + 8);
if ((c = strchr(release, ' '))) *c = '\0'; if ((c = strchr(release, ' '))) *c = '\0';
if ((c = strchr(sysname, ' '))) *c = '\0'; if ((c = strchr(sysname, ' '))) *c = '\0';
if (strcmp(sysname, "Red") == MATCH) sstrlcpy(sysname, "RedHat"); if (strcmp(sysname, "Red") == MATCH) sstrlcpy(sysname, "RedHat");
} }