diff options
| author | Dan Engelbrecht <[email protected]> | 2024-10-16 09:49:55 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-10-16 09:49:55 +0200 |
| commit | b254f75968e1a5692fa872fcfda5eaa1a0ed561d (patch) | |
| tree | 968e5fc30e37295a4c5767d5c290016116e196ab /src/zencore/thread.cpp | |
| parent | upload linux mac exe to sentry (#196) (diff) | |
| download | zen-b254f75968e1a5692fa872fcfda5eaa1a0ed561d.tar.xz zen-b254f75968e1a5692fa872fcfda5eaa1a0ed561d.zip | |
safer path from handle (#195)
* remove PathFromHandle that throws to give better context on failures
Diffstat (limited to 'src/zencore/thread.cpp')
| -rw-r--r-- | src/zencore/thread.cpp | 12 |
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); |