1
0
mirror of https://github.com/gophernicus/gophernicus.git synced 2025-02-02 15:08:00 -05:00

Merge pull request #120 from zcrayfish/patch-1

Update platform.c: Detect Alpine Linux properly.
This commit is contained in:
Samuel Tyler 2024-12-29 10:33:05 +11:00 committed by GitHub
commit b1fd65a0a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -230,6 +230,14 @@ void platform(state *st)
}
}
/* Alpine Linux version should be in /etc/alpine-release */
if (!*release && (fp = fopen("/etc/alpine-release", "r"))) {
sstrlcpy(sysname, "Alpine Linux");
if (fgets (release, sizeof(release), fp) != NULL)
if ((c = strchr(release, '/'))) *c = '\0';
fclose(fp);
}
/* OK, nothing worked - let's try /etc/issue for sysname */
if (!*sysname && (fp = fopen("/etc/issue", "r"))) {
if (fgets(sysname, sizeof(sysname), fp) != NULL) {