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:
parent
58af1ae88c
commit
e5d8d6ae67
3 changed files with 10 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue