aboutsummaryrefslogtreecommitdiff
path: root/src/zencore
diff options
context:
space:
mode:
authorLiam Mitchell <[email protected]>2025-02-27 02:16:10 +0000
committerLiam Mitchell <[email protected]>2025-02-27 02:16:10 +0000
commitc49b0a053c5e28de1afa83600ebffd383766e38a (patch)
tree3b9e7880e09ff816edd1fc9f996015ed9e6ee522 /src/zencore
parentLinux compilation fixes (diff)
downloadzen-c49b0a053c5e28de1afa83600ebffd383766e38a.tar.xz
zen-c49b0a053c5e28de1afa83600ebffd383766e38a.zip
Implementation of service commands for Linux.
Diffstat (limited to 'src/zencore')
-rw-r--r--src/zencore/include/zencore/process.h4
-rw-r--r--src/zencore/process.cpp7
2 files changed, 8 insertions, 3 deletions
diff --git a/src/zencore/include/zencore/process.h b/src/zencore/include/zencore/process.h
index 42b997c39..36c2a2481 100644
--- a/src/zencore/include/zencore/process.h
+++ b/src/zencore/include/zencore/process.h
@@ -101,6 +101,10 @@ int GetProcessId(CreateProcResult ProcId);
std::filesystem::path GetProcessExecutablePath(int Pid, std::error_code& OutEc);
std::error_code FindProcess(const std::filesystem::path& ExecutableImage, ProcessHandle& OutHandle);
+#if ZEN_PLATFORM_LINUX
+void IgnoreChildSignals();
+#endif
+
void process_forcelink(); // internal
} // namespace zen
diff --git a/src/zencore/process.cpp b/src/zencore/process.cpp
index 8dc86371e..9f0c9578f 100644
--- a/src/zencore/process.cpp
+++ b/src/zencore/process.cpp
@@ -40,7 +40,9 @@ ZEN_THIRD_PARTY_INCLUDES_END
namespace zen {
#if ZEN_PLATFORM_LINUX
-const bool bNoZombieChildren = []() {
+void
+IgnoreChildSignals()
+{
// When a child process exits it is put into a zombie state until the parent
// collects its result. This doesn't fit the Windows-like model that Zen uses
// where there is a less strict familial model and no zombification. Ignoring
@@ -51,8 +53,7 @@ const bool bNoZombieChildren = []() {
sigemptyset(&Action.sa_mask);
Action.sa_handler = SIG_IGN;
sigaction(SIGCHLD, &Action, nullptr);
- return true;
-}();
+}
static char
GetPidStatus(int Pid, std::error_code& OutEc)