aboutsummaryrefslogtreecommitdiff
path: root/zencore/thread.cpp
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2022-02-21 12:42:42 +0100
committerMartin Ridgers <[email protected]>2022-02-21 12:42:42 +0100
commitcea930e12929859608c102a378c01c209b523688 (patch)
tree1fc44e5cf629529aa9f0c6e413cc8efc9236d6a9 /zencore/thread.cpp
parentValue propagation fix - Read/Write ValueAPI as CompressedBinary type when wri... (diff)
downloadzen-cea930e12929859608c102a378c01c209b523688.tar.xz
zen-cea930e12929859608c102a378c01c209b523688.zip
Marked a few file descriptors to be closed on execute (POSIX)
Diffstat (limited to 'zencore/thread.cpp')
-rw-r--r--zencore/thread.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/zencore/thread.cpp b/zencore/thread.cpp
index 33ea3e95d..313f253f1 100644
--- a/zencore/thread.cpp
+++ b/zencore/thread.cpp
@@ -270,7 +270,7 @@ NamedEvent::NamedEvent(std::string_view EventName)
ExtendableStringBuilder<64> EventPath;
EventPath << "/tmp/" << EventName;
- int Fd = open(EventPath.c_str(), O_RDWR | O_CREAT, 0666);
+ int Fd = open(EventPath.c_str(), O_RDWR | O_CREAT | O_CLOEXEC, 0666);
if (Fd < 0)
{
ThrowLastError(fmt::format("Failed to create '{}' for named event", EventPath));
@@ -489,7 +489,7 @@ NamedMutex::Exists(std::string_view MutexName)
Name << "/tmp/" << MutexName;
bool bExists = false;
- int Fd = open(Name.c_str(), O_RDWR, 0666);
+ int Fd = open(Name.c_str(), O_RDWR | O_CLOEXEC, 0666);
if (Fd >= 0)
{
if (flock(Fd, LOCK_EX | LOCK_NB) == 0)