mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-01 04:03:24 +03:00
Fix CMAKE_HOST_SYSTEM_NAME on SunOS
In commit 0bbd993f (Make CMAKE_HOST_SYSTEM_NAME available in scripting
context, 2016-12-26) we added a call to `uname` that checks for a zero
return value. However, on Solaris the `uname(2)` manual [1] says that
on success a non-negative value is returned. Fix our return code check
so that we detect the `SunOS` name correctly.
[1] https://docs.oracle.com/cd/E53394_01/html/E54765/uname-2.html
This commit is contained in:
1 parent
717e1f3056
commit
c1aaf8a61d
1 file changed
+1
-1
@@ -308,7 +308,7 @@ void cmStateSnapshot::SetDefaultDefinitions()
|
||||
this->SetDefinition("CMAKE_HOST_UNIX", "1");
|
||||
|
||||
struct utsname uts_name;
|
||||
if (uname(&uts_name) == 0) {
|
||||
if (uname(&uts_name) >= 0) {
|
||||
this->SetDefinition("CMAKE_HOST_SYSTEM_NAME", uts_name.sysname);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user