aboutsummaryrefslogtreecommitdiff
path: root/zenstore/basicfile.cpp
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2022-01-07 12:59:34 +0100
committerMartin Ridgers <[email protected]>2022-01-07 13:03:11 +0100
commitb56ee944101c3e46a2c58631fc768642f6a3461d (patch)
treeaab5a0bf5f28d8e42d0ba42d5e9e99c6cd1955cc /zenstore/basicfile.cpp
parentMissing include (diff)
downloadzen-b56ee944101c3e46a2c58631fc768642f6a3461d.tar.xz
zen-b56ee944101c3e46a2c58631fc768642f6a3461d.zip
Enabled POSIX-compatible implementations on Mac
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;