mirror of
https://github.com/gophernicus/gophernicus.git
synced 2024-12-04 14:46:37 -05:00
Added detection for CRUX Linux
This commit is contained in:
parent
74851cf592
commit
2bd8caed82
@ -1,5 +1,9 @@
|
||||
[ Automatically generated from git log ]
|
||||
|
||||
2014-12-19 Kim Holviala <kim@holviala.com>
|
||||
|
||||
* Added $SESSION_ID environment variable for CGI scripts
|
||||
|
||||
2014-11-10 Kim Holviala <kim@holviala.com>
|
||||
|
||||
* Added MacOSX 10.10 to the list of supported systems in INSTALL
|
||||
|
19
platform.c
19
platform.c
@ -35,13 +35,11 @@ void platform(state *st)
|
||||
#if defined(_AIX) || defined(__linux) || defined(__APPLE__)
|
||||
FILE *fp;
|
||||
#endif
|
||||
#if defined(__arm__) || defined(__mips__) || defined(__APPLE__)
|
||||
char buf[BUFSIZE];
|
||||
#endif
|
||||
#ifdef __linux
|
||||
struct stat file;
|
||||
#endif
|
||||
struct utsname name;
|
||||
char buf[BUFSIZE];
|
||||
char sysname[64];
|
||||
char release[64];
|
||||
char machine[64];
|
||||
@ -159,6 +157,21 @@ void platform(state *st)
|
||||
}
|
||||
}
|
||||
|
||||
/* Identify CRUX */
|
||||
if (!*sysname && stat("/usr/bin/crux", &file) == OK && (file.st_mode & S_IXOTH)) {
|
||||
|
||||
sstrlcpy(sysname, "CRUX");
|
||||
|
||||
if ((fp = popen("/usr/bin/crux", "r"))) {
|
||||
fgets(buf, sizeof(buf), fp);
|
||||
pclose(fp);
|
||||
|
||||
if ((c = strchr(buf, ' ')) && (c = strchr(c + 1, ' ')))
|
||||
sstrlcpy(release, c + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Uh-oh.... how about a standard Linux with lsb_release? */
|
||||
if (stat("/usr/bin/lsb_release", &file) == OK && (file.st_mode & S_IXOTH)) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user