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 Return "Unknown" if uname fails
Remove the check for NULL from os_software_version since that can't happen anymore.
- - - - -
2 changed files:
- src/code/misc.lisp - src/lisp/os-common.c
Changes:
===================================== src/code/misc.lisp ===================================== @@ -101,8 +101,7 @@ (alien:alien-funcall (alien:extern-alien "os_software_version" (function (alien:* c-call:c-string))))) - (unless (zerop (sap-int (alien:alien-sap version))) - (alien:cast version c-call:c-string)))))) + (alien:cast version c-call:c-string))))) *software-version*))
(defvar *short-site-name* nil
===================================== src/lisp/os-common.c ===================================== @@ -828,19 +828,20 @@ os_software_version(void)
int status;
+ strcpy(result, "Unknown"); + status = uname(&uts); - if (status != 0) { - return NULL; - } + if (status == 0) {
#if defined(UNAME_RELEASE_AND_VERSION) - strcpy(result, uts.release); - strcat(result, " "); - strcat(result, uts.version); + strcpy(result, uts.release); + strcat(result, " "); + strcat(result, uts.version); #else - strcpy(result, uts.version); + strcpy(result, uts.version); #endif - + } + return result; } #undef UNAME_RELEASE_AND_VERSION
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/4abd79359ba5607a1351f224...