diff options
| author | Martin Ridgers <[email protected]> | 2022-01-07 12:59:34 +0100 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2022-01-07 13:03:11 +0100 |
| commit | b56ee944101c3e46a2c58631fc768642f6a3461d (patch) | |
| tree | aab5a0bf5f28d8e42d0ba42d5e9e99c6cd1955cc /zenstore/filecas.cpp | |
| parent | Missing include (diff) | |
| download | zen-b56ee944101c3e46a2c58631fc768642f6a3461d.tar.xz zen-b56ee944101c3e46a2c58631fc768642f6a3461d.zip | |
Enabled POSIX-compatible implementations on Mac
Diffstat (limited to 'zenstore/filecas.cpp')
| -rw-r--r-- | zenstore/filecas.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/zenstore/filecas.cpp b/zenstore/filecas.cpp index 76b921994..7e3e071fb 100644 --- a/zenstore/filecas.cpp +++ b/zenstore/filecas.cpp @@ -271,7 +271,7 @@ FileCasStrategy::InsertChunk(IoBuffer Chunk, const IoHash& ChunkHash) ChunkHash); DeletePayloadFileOnClose(); -#elif ZEN_PLATFORM_LINUX +#elif ZEN_PLATFORM_LINUX || ZEN_PLATFORM_MAC std::filesystem::path SourcePath = PathFromHandle(FileRef.FileHandle); std::filesystem::path DestPath = Name.ShardedPath.c_str(); int Ret = link(SourcePath.c_str(), DestPath.c_str()); @@ -311,8 +311,6 @@ FileCasStrategy::InsertChunk(IoBuffer Chunk, const IoHash& ChunkHash) { return CasStore::InsertResult{.New = true}; } -#else -# error check link/unlink for this platform #endif // ZEN_PLATFORM_* } @@ -345,13 +343,11 @@ FileCasStrategy::InsertChunk(const void* const ChunkData, const size_t ChunkSize } PayloadFile.Close(); -#elif ZEN_PLATFORM_LINUX +#elif ZEN_PLATFORM_LINUX || ZEN_PLATFORM_MAC if (access(Name.ShardedPath.c_str(), F_OK) == 0) { return CasStore::InsertResult{.New = false}; } -#else -# error Check access() for this platform #endif RwLock::ExclusiveLockScope _(LockForHash(ChunkHash)); |