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:
parent
c77c0dd87d
commit
af88bc0bff
12
platform.c
12
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");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user