aboutsummaryrefslogtreecommitdiff
path: root/zenutil/zenserverprocess.cpp
diff options
context:
space:
mode:
authorPer Larsson <[email protected]>2021-09-20 08:54:34 +0200
committerPer Larsson <[email protected]>2021-09-20 08:54:34 +0200
commite25b4b20d8a5696aa7055c9c167fa47b3739bc7e (patch)
tree049654b87096a22e1bf696a385db608a75f229fa /zenutil/zenserverprocess.cpp
parentProbe upstream Zen server when initializing upstream cache. (diff)
parentFixed unused variable warnings exposed by xmake build (unclear why I do not r... (diff)
downloadzen-e25b4b20d8a5696aa7055c9c167fa47b3739bc7e.tar.xz
zen-e25b4b20d8a5696aa7055c9c167fa47b3739bc7e.zip
Merge branch 'main' of https://github.com/EpicGames/zen
Diffstat (limited to 'zenutil/zenserverprocess.cpp')
-rw-r--r--zenutil/zenserverprocess.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/zenutil/zenserverprocess.cpp b/zenutil/zenserverprocess.cpp
index c504ce7da..9e370ae10 100644
--- a/zenutil/zenserverprocess.cpp
+++ b/zenutil/zenserverprocess.cpp
@@ -40,20 +40,16 @@ namespace zenutil {
m_Attributes.nLength = sizeof m_Attributes;
m_Attributes.bInheritHandle = false; // Disable inheritance
- const BOOL success = InitializeSecurityDescriptor(&m_Sd, SECURITY_DESCRIPTOR_REVISION);
+ const BOOL Success = InitializeSecurityDescriptor(&m_Sd, SECURITY_DESCRIPTOR_REVISION);
- if (success)
+ if (Success)
{
- const BOOL bSetOk = SetSecurityDescriptorDacl(&m_Sd, TRUE, (PACL)NULL, FALSE);
-
- if (bSetOk)
- {
- m_Attributes.lpSecurityDescriptor = &m_Sd;
- }
- else
+ if (!SetSecurityDescriptorDacl(&m_Sd, TRUE, (PACL)NULL, FALSE))
{
zen::ThrowLastError("SetSecurityDescriptorDacl failed", std::source_location::current());
}
+
+ m_Attributes.lpSecurityDescriptor = &m_Sd;
}
}
};
@@ -129,7 +125,8 @@ ZenServerState::Initialize()
zen::ThrowLastError("Could not map view of Zen server state");
}
- m_Data = reinterpret_cast<ZenServerEntry*>(pBuf);
+ m_Data = reinterpret_cast<ZenServerEntry*>(pBuf);
+ m_IsReadOnly = false;
}
bool
@@ -221,6 +218,8 @@ ZenServerState::Sweep()
return;
}
+ ZEN_ASSERT(m_IsReadOnly == false);
+
for (int i = 0; i < m_MaxEntryCount; ++i)
{
ZenServerEntry& Entry = m_Data[i];