aboutsummaryrefslogtreecommitdiff
path: root/zenstore/basicfile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zenstore/basicfile.cpp')
-rw-r--r--zenstore/basicfile.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/zenstore/basicfile.cpp b/zenstore/basicfile.cpp
index fcd65f67d..41d296cbb 100644
--- a/zenstore/basicfile.cpp
+++ b/zenstore/basicfile.cpp
@@ -335,11 +335,9 @@ LockFile::LockFile()
LockFile::~LockFile()
{
-#if ZEN_PLATFORM_LINUX
+#if ZEN_PLATFORM_LINUX || ZEN_PLATFORM_MAC
int Fd = int(intptr_t(m_FileHandle));
flock(Fd, LOCK_UN | LOCK_NB);
-#elif ZEN_PLATFORM_MAC
-# error check flock() support
#endif
}
@@ -369,7 +367,7 @@ LockFile::Create(std::filesystem::path FileName, CbObject Payload, std::error_co
return;
}
-#elif ZEN_PLATFORM_LINUX
+#elif ZEN_PLATFORM_LINUX || ZEN_PLATFORM_MAC
int Fd = open(FileName.c_str(), O_RDWR | O_CREAT, 0666);
if (Fd < 0)
{
@@ -386,8 +384,6 @@ LockFile::Create(std::filesystem::path FileName, CbObject Payload, std::error_co
}
void* FileHandle = (void*)uintptr_t(Fd);
-#else
-# error check flock() support
#endif
m_FileHandle = FileHandle;