loolwsd: set ShutdownFlag only with SIGINT
The logic is to use ShutdownFlag only in WSD to initiate graceful shut down while saving documents. When CTRL+C is hit WSD, forkit, and kits get SIGINT, but only WSD should handle ShutdownFlag. Others are signaled internally by WSD to terminate using SIGTERM. The second CTRL+C on WSD will flag TerminationFlag for more aggressive shutdown. This is logged on every subsequent signal and not just the first. Furthermore, any other signal to WSD should terminate more aggressively, so no reason to set ShutdownFlag in those cases. Change-Id: I10fa38fe85925da1020983f897cc6cdbbd2623f8 Reviewed-on: https://gerrit.libreoffice.org/30887 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com>
This commit is contained in:
parent
f7b6ece593
commit
0f9bd80ca2
1 changed files with 2 additions and 4 deletions
|
@ -119,17 +119,15 @@ namespace SigUtil
|
|||
static
|
||||
void handleTerminationSignal(const int signal)
|
||||
{
|
||||
if (!ShutdownFlag)
|
||||
if (!ShutdownFlag && signal == SIGINT)
|
||||
{
|
||||
Log::signalLogPrefix();
|
||||
Log::signalLog(" Shutdown signal received: ");
|
||||
Log::signalLog(signalName(signal));
|
||||
Log::signalLog("\n");
|
||||
ShutdownFlag = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!TerminationFlag)
|
||||
else
|
||||
{
|
||||
Log::signalLogPrefix();
|
||||
Log::signalLog(" Forced-Termination signal received: ");
|
||||
|
|
Loading…
Reference in a new issue