[Libreoffice-commits] online.git: loolwsd/common
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Wed Nov 16 04:42:03 UTC 2016
loolwsd/common/SigUtil.cpp | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
New commits:
commit 0f9bd80ca27db7aec057dbd494df60e3dc003a11
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Tue Nov 15 21:57:41 2016 -0500
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 at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/loolwsd/common/SigUtil.cpp b/loolwsd/common/SigUtil.cpp
index f3e7f03..7931776 100644
--- a/loolwsd/common/SigUtil.cpp
+++ b/loolwsd/common/SigUtil.cpp
@@ -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: ");
More information about the Libreoffice-commits
mailing list