0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-28 00:14:07 +01:00

construct: Improve console interrupt related.

This commit is contained in:
Jason Volk 2018-04-06 23:35:25 -07:00
parent 58af1ae88c
commit e5d8d6ae67
3 changed files with 10 additions and 3 deletions

View file

@ -345,7 +345,10 @@ void
check_console_active()
{
if(console_active)
throw ircd::error("Console is already active and cannot be reentered");
throw ircd::error
{
"Console is already active and cannot be reentered"
};
}
void

View file

@ -334,8 +334,11 @@ bool
handle_interruption()
try
{
console_cancel();
console_spawn();
if(console_active)
console_cancel();
else
console_spawn();
return true;
}
catch(const std::exception &e)

View file

@ -18,6 +18,7 @@ extern std::unique_ptr<boost::asio::io_service> ios;
// console.cc
//
extern bool console_active;
void console_spawn();
void console_execute(const std::vector<std::string> &lines);
void console_cancel();