summaryrefslogtreecommitdiffstats
path: root/kit
diff options
context:
space:
mode:
Diffstat (limited to 'kit')
-rw-r--r--kit/ForKit.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/kit/ForKit.cpp b/kit/ForKit.cpp
index f96eb94d1c..069da7a3e9 100644
--- a/kit/ForKit.cpp
+++ b/kit/ForKit.cpp
@@ -435,6 +435,8 @@ static int createLibreOfficeKit(const std::string& childRoot,
ForKitPoll->closeAllSockets();
// else very first kit process spawned
+ SigUtil::setSigChildHandler(nullptr);
+
UnitKit::get().postFork();
sleepForDebugger();
@@ -499,6 +501,14 @@ static void printArgumentHelp()
std::cout << "" << std::endl;
}
+extern "C" {
+ static void wakeupPoll(uint32_t /*pid*/)
+ {
+ if (ForKitPoll)
+ ForKitPoll->wakeup();
+ }
+}
+
int forkit_main(int argc, char** argv)
{
/*WARNING: PRIVILEGED CODE CHECKING START */
@@ -781,6 +791,9 @@ int forkit_main(int argc, char** argv)
ForKitPoll.reset(new SocketPoll (Util::getThreadName()));
ForKitPoll->runOnClientThread(); // We will do the polling on this thread.
+ // Reap zombies when we get the signal
+ SigUtil::setSigChildHandler(wakeupPoll);
+
WSHandler = std::make_shared<ServerWSHandler>("forkit_ws");
if (!Util::isMobileApp() &&