summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@mit.edu>2007-12-28 01:06:52 +0000
committerGravatar Karl Ramm <kcr@mit.edu>2007-12-28 01:06:52 +0000
commit92a6bdd61902ebd8ceadf79588845ff9bcc78d38 (patch)
tree40378a799916578e05e07c2efeab93bc93a0ae80
parentc66aa6f9018f247cf0e6c7274871dcaf7bb4daaf (diff)
if the #if ladder doesn't find anything, fall back to uname.
-rw-r--r--server/version.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/server/version.c b/server/version.c
index 230a66c..f397f5f 100644
--- a/server/version.c
+++ b/server/version.c
@@ -12,6 +12,8 @@
#include <zephyr/mit-copyright.h>
+#include <sys/utsname.h>
+
#include "zserver.h"
#include "version.h"
@@ -34,6 +36,7 @@ char *
get_version()
{
static char vers_buf[256];
+ struct utsname un;
if (vers_buf[0] == '\0') {
#ifdef DEBUG
@@ -73,11 +76,13 @@ get_version()
#ifdef NeXT
(void) strcat(vers_buf, "NeXT");
#endif /* NeXT */
+
+ if (vers_buf[strlen(vers_buf) - 1] == '/') {
+ uname(&un);
+ (void) strcat(vers_buf, un.machine);
+ (void) strcat(vers_buf, "-");
+ (void) strcat(vers_buf, un.sysname);
+ }
}
return(vers_buf);
}
-
-
-
-
-