diff options
-rw-r--r-- | src/base/platform/unix/PosixSpawnSubProcess.cpp | 6 | ||||
-rw-r--r-- | test/common/platform/unix/UnixFileStreamTest.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/base/platform/unix/PosixSpawnSubProcess.cpp b/src/base/platform/unix/PosixSpawnSubProcess.cpp index 25e6c38c..34ae6622 100644 --- a/src/base/platform/unix/PosixSpawnSubProcess.cpp +++ b/src/base/platform/unix/PosixSpawnSubProcess.cpp @@ -103,9 +103,9 @@ void PosixSpawnSubProcessImpl::PlatformCreateProcess( u"Failed to call posix_spawnattr_init."); Guard attr_guard([&attr] { posix_spawnattr_destroy(&attr); }); -#ifdef CRU_PLATFORM_OSX - error = posix_spawnattr_setflags(&attr, POSIX_SPAWN_CLOEXEC_DEFAULT); - check_error(u"Failed to set flag POSIX_SPAWN_CLOEXEC_DEFAULT (osx)."); +#ifdef __APPLE__ + check_error(posix_spawnattr_setflags(&attr, POSIX_SPAWN_CLOEXEC_DEFAULT), + u"Failed to set flag POSIX_SPAWN_CLOEXEC_DEFAULT (osx)."); #endif auto exe = start_info.program.ToUtf8(); diff --git a/test/common/platform/unix/UnixFileStreamTest.cpp b/test/common/platform/unix/UnixFileStreamTest.cpp index fa99aa29..417fccc2 100644 --- a/test/common/platform/unix/UnixFileStreamTest.cpp +++ b/test/common/platform/unix/UnixFileStreamTest.cpp @@ -13,7 +13,7 @@ TEST_CASE("UnixFileStream Work", "[stream]") { auto temp_file_path = (std::filesystem::temp_directory_path() / "cru_test_temp.XXXXXX") .generic_string(); - mktemp(temp_file_path.data()); + mkstemp(temp_file_path.data()); UnixFileStream file(temp_file_path.c_str(), O_WRONLY | O_CREAT); file.Write("abc", 3); |