From 3c556043fd111dfe2937283ebb847b2b1ab5bc64 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 3 Oct 2019 16:08:16 -0700 Subject: [PATCH] construct: Improve console termination related. --- construct/console.cc | 6 +++++- construct/signals.cc | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/construct/console.cc b/construct/console.cc index fe5aaf62f..e0c37a9cb 100644 --- a/construct/console.cc +++ b/construct/console.cc @@ -499,8 +499,12 @@ construct::console::on_runlevel(const enum ircd::run::level &runlevel) switch(runlevel) { case ircd::run::level::QUIT: + if(terminate()) + context.join(); + break; + case ircd::run::level::HALT: - console::terminate(); + terminate(); break; default: diff --git a/construct/signals.cc b/construct/signals.cc index e0c813ead..2242a89d6 100644 --- a/construct/signals.cc +++ b/construct/signals.cc @@ -55,6 +55,7 @@ construct::signals::on_runlevel(const enum ircd::run::level &level) switch(level) { case ircd::run::level::HALT: + case ircd::run::level::QUIT: signal_set->cancel(); break; @@ -185,6 +186,7 @@ void construct::handle_quit() try { + console::terminate(); ircd::quit(); } catch(const std::exception &e)