diff options
author | Brad King <brad.king@kitware.com> | 2022-01-31 15:29:26 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-01-31 15:29:38 (GMT) |
commit | 3de6155ca08e2c308ffe075b6efcb949907bba71 (patch) | |
tree | 5e6c25d2f494eb8f8f7a4da3181d98387a7d19a8 | |
parent | 440bd4845bc9136c2433a3c362434b76c74bed62 (diff) | |
parent | e83bb7516038e6ad10927a0c7359d5118acce1df (diff) | |
download | CMake-3de6155ca08e2c308ffe075b6efcb949907bba71.zip CMake-3de6155ca08e2c308ffe075b6efcb949907bba71.tar.gz CMake-3de6155ca08e2c308ffe075b6efcb949907bba71.tar.bz2 |
Merge topic 'update-kwsys'
e83bb75160 Merge branch 'upstream-KWSys' into update-kwsys
d01d634bc7 KWSys 2022-01-29 (389a74dc)
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6919
-rw-r--r-- | Source/kwsys/ProcessUNIX.c | 6 | ||||
-rw-r--r-- | Source/kwsys/testSystemTools.cxx | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c index 1963b27..19bf982 100644 --- a/Source/kwsys/ProcessUNIX.c +++ b/Source/kwsys/ProcessUNIX.c @@ -41,6 +41,12 @@ do. /* Increase the file descriptor limit for select() before including related system headers. (Default: 64) */ # define FD_SETSIZE 16384 +#elif defined(__APPLE__) +/* Increase the file descriptor limit for select() before including + related system headers. (Default: 1024) */ +# define _DARWIN_UNLIMITED_SELECT +# include <limits.h> /* OPEN_MAX */ +# define FD_SETSIZE OPEN_MAX #endif #include <assert.h> /* assert */ diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx index e88a481..21d6f04 100644 --- a/Source/kwsys/testSystemTools.cxx +++ b/Source/kwsys/testSystemTools.cxx @@ -295,12 +295,15 @@ static bool CheckFileOperations() // Reset umask #ifdef __MSYS__ mode_t fullMask = S_IWRITE; + mode_t testPerm = S_IREAD; #elif defined(_WIN32) && !defined(__CYGWIN__) // NOTE: Windows doesn't support toggling _S_IREAD. mode_t fullMask = _S_IWRITE; + mode_t testPerm = 0; #else // On a normal POSIX platform, we can toggle all permissions. mode_t fullMask = S_IRWXU | S_IRWXG | S_IRWXO; + mode_t testPerm = S_IRUSR; #endif // Test file permissions without umask @@ -311,7 +314,7 @@ static bool CheckFileOperations() res = false; } - if (!kwsys::SystemTools::SetPermissions(testNewFile, 0)) { + if (!kwsys::SystemTools::SetPermissions(testNewFile, testPerm)) { std::cerr << "Problem with SetPermissions (1) for: " << testNewFile << std::endl; res = false; @@ -323,10 +326,10 @@ static bool CheckFileOperations() res = false; } - if ((thisPerm & fullMask) != 0) { + if ((thisPerm & fullMask) != testPerm) { std::cerr << "SetPermissions failed to set permissions (1) for: " << testNewFile << ": actual = " << thisPerm - << "; expected = " << 0 << std::endl; + << "; expected = " << testPerm << std::endl; res = false; } |