From aaeee9ac1bec57493acdf4802f08cccbfd76defa Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Thu, 31 Aug 2023 03:47:03 -0400 Subject: fix zen server state mac mmap (#380) * use MAP_SHARED when initializing read only access of shared memory * changelog --- CHANGELOG.md | 3 +++ src/zenutil/zenserverprocess.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d522c13d..87ddd1a3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ ## +- Bugfix: Fix zen command executable not being able to access shared status memory (`zen status`, `zen down` etc fails) on MacOs + +## 0.2.18 - Feature: Add `--embedloosefiles` option to `oplog-export` which adds loose files to the export, removing need to call `oplog-snapshot` - Bugfix: Fix construction order in OpenProcessCache to avoid crash in OpenProcessCache::GcWorker - Bugfix: Retain `ServerPath` in oplog when performing `oplog-snapshot`. This is a short-term fix for current incompatibility with the UE cooker. diff --git a/src/zenutil/zenserverprocess.cpp b/src/zenutil/zenserverprocess.cpp index c939d3f39..2f5402434 100644 --- a/src/zenutil/zenserverprocess.cpp +++ b/src/zenutil/zenserverprocess.cpp @@ -216,7 +216,7 @@ ZenServerState::InitializeReadOnly() } void* hMap = (void*)intptr_t(Fd); - void* pBuf = mmap(nullptr, MapSize, PROT_READ, MAP_PRIVATE, Fd, 0); + void* pBuf = mmap(nullptr, MapSize, PROT_READ, MAP_SHARED, Fd, 0); if (pBuf == MAP_FAILED) { ThrowLastError("Could not map read-only view of Zen server state"); -- cgit v1.2.3