diff options
Diffstat (limited to 'src/zencore')
| -rw-r--r-- | src/zencore/process.cpp | 4 | ||||
| -rw-r--r-- | src/zencore/thread.cpp | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/zencore/process.cpp b/src/zencore/process.cpp index 3d6a67ada..8049130da 100644 --- a/src/zencore/process.cpp +++ b/src/zencore/process.cpp @@ -853,6 +853,10 @@ IsProcessRunning(int pid, std::error_code& OutEc) { return false; } + else if (Error == EPERM) + { + return true; // Running under a user we don't have access to, assume it is live + } else { OutEc = MakeErrorCode(Error); diff --git a/src/zencore/thread.cpp b/src/zencore/thread.cpp index ab7e6857a..fef5c28a4 100644 --- a/src/zencore/thread.cpp +++ b/src/zencore/thread.cpp @@ -483,7 +483,7 @@ NamedMutex::Create(std::string_view MutexName) ExtendableStringBuilder<64> Name; Name << "/tmp/" << MutexName; - int Inner = open(Name.c_str(), O_RDWR | O_CREAT | O_CLOEXEC, 0666); + int Inner = open(Name.c_str(), O_RDWR | O_CREAT | O_CLOEXEC, geteuid() == 0 ? 0766 : 0666); if (Inner < 0) { return false; |