use SigUtil::setUserSignals before creating SocketPoll

The SocketPoll ctor which may, depending on COOL_WATCHDOG env variable,
want to override the SIG2 handler so set user signal handlers before
that otherwise tthat choice is overwritten

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I305570ab8becb41f0696e60908c1ca26fd9ba14a
pull/8761/head
Caolán McNamara 2024-04-12 22:03:03 +01:00 committed by Michael Meeks
parent 28e880e6b0
commit bae0a91082
1 changed files with 5 additions and 2 deletions

View File

@ -807,6 +807,11 @@ int forkit_main(int argc, char** argv)
Log::logger().setLevel(LogLevel);
}
// The SocketPoll ctor which may, depending on COOL_WATCHDOG env variable,
// want to override the SIG2 handler so set user signal handlers before
// that otherwise that choice is overwritten
SigUtil::setUserSignals();
ForKitPoll.reset(new SocketPoll (Util::getThreadName()));
ForKitPoll->runOnClientThread(); // We will do the polling on this thread.
@ -822,8 +827,6 @@ int forkit_main(int argc, char** argv)
Util::forcedExit(EX_SOFTWARE);
}
SigUtil::setUserSignals();
const int parentPid = getppid();
LOG_INF("ForKit process is ready. Parent: " << parentPid);