loolwsd/common/SigUtil.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
New commits: commit 0f9bd80ca27db7aec057dbd494df60e3dc003a11 Author: Ashod Nakashian <ashod.nakash...@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 <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@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: "); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits