aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zencore/thread.cpp')
-rw-r--r--src/zencore/thread.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/zencore/thread.cpp b/src/zencore/thread.cpp
index 394197b8e..ca3759fbf 100644
--- a/src/zencore/thread.cpp
+++ b/src/zencore/thread.cpp
@@ -348,8 +348,16 @@ NamedEvent::Close()
if (flock(Fd, LOCK_EX | LOCK_NB) == 0)
{
- std::filesystem::path Name = PathFromHandle((void*)(intptr_t(Fd)));
- unlink(Name.c_str());
+ std::error_code Ec;
+ std::filesystem::path Name = PathFromHandle((void*)(intptr_t(Fd)), Ec);
+ if (Ec)
+ {
+ ZEN_WARN("Error reported on get file path from handle {} for named event unlink operation, reason '{}'", Fd, Ec.message());
+ }
+ else
+ {
+ unlink(Name.c_str());
+ }
flock(Fd, LOCK_UN | LOCK_NB);
close(Fd);