Raymond Toy pushed to branch issue-120-software-type-in-c at cmucl / cmucl
Commits:
-
4abd7935
by Raymond Toy at 2023-03-25T08:02:09-07:00
2 changed files:
Changes:
... | ... | @@ -101,8 +101,7 @@ |
101 | 101 | (alien:alien-funcall
|
102 | 102 | (alien:extern-alien "os_software_version"
|
103 | 103 | (function (alien:* c-call:c-string)))))
|
104 | - (unless (zerop (sap-int (alien:alien-sap version)))
|
|
105 | - (alien:cast version c-call:c-string))))))
|
|
104 | + (alien:cast version c-call:c-string)))))
|
|
106 | 105 | *software-version*))
|
107 | 106 | |
108 | 107 | (defvar *short-site-name* nil
|
... | ... | @@ -828,19 +828,20 @@ os_software_version(void) |
828 | 828 | |
829 | 829 | int status;
|
830 | 830 | |
831 | + strcpy(result, "Unknown");
|
|
832 | + |
|
831 | 833 | status = uname(&uts);
|
832 | - if (status != 0) {
|
|
833 | - return NULL;
|
|
834 | - }
|
|
834 | + if (status == 0) {
|
|
835 | 835 |
|
836 | 836 | #if defined(UNAME_RELEASE_AND_VERSION)
|
837 | - strcpy(result, uts.release);
|
|
838 | - strcat(result, " ");
|
|
839 | - strcat(result, uts.version);
|
|
837 | + strcpy(result, uts.release);
|
|
838 | + strcat(result, " ");
|
|
839 | + strcat(result, uts.version);
|
|
840 | 840 | #else
|
841 | - strcpy(result, uts.version);
|
|
841 | + strcpy(result, uts.version);
|
|
842 | 842 | #endif
|
843 | - |
|
843 | + }
|
|
844 | +
|
|
844 | 845 | return result;
|
845 | 846 | }
|
846 | 847 | #undef UNAME_RELEASE_AND_VERSION |