diff --git a/ChangeLog b/ChangeLog index 7955686..2604aab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ [ Automatically generated from git log ] +2014-12-19 Kim Holviala + + * Added $SESSION_ID environment variable for CGI scripts + 2014-11-10 Kim Holviala * Added MacOSX 10.10 to the list of supported systems in INSTALL diff --git a/platform.c b/platform.c index ed8802b..35cb7a5 100644 --- a/platform.c +++ b/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)) {