1
0
mirror of https://github.com/gophernicus/gophernicus.git synced 2024-09-22 04:35:56 -04:00

Added detection for CRUX Linux

This commit is contained in:
Kim Holviala 2014-12-19 15:01:15 +02:00
parent 74851cf592
commit 2bd8caed82
2 changed files with 20 additions and 3 deletions

View File

@ -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

View File

@ -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)) {