From b56ee944101c3e46a2c58631fc768642f6a3461d Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Fri, 7 Jan 2022 12:59:34 +0100 Subject: Enabled POSIX-compatible implementations on Mac --- zenstore/basicfile.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'zenstore/basicfile.cpp') 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; -- cgit v1.2.3