aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonero-project <sempre.amaro@gmail.com>2014-06-13 12:01:07 -0400
committermonero-project <sempre.amaro@gmail.com>2014-06-13 12:01:07 -0400
commit94cc5a7d718a0dc0efe28af8dfc0955c8525a9a1 (patch)
tree41d43e43e3be9cbbbdd40275891623d21fde5bda
parentMerge pull request #35 from tewinget/master (diff)
parentFixed console handler not properly exiting on SIGINT and such (diff)
downloadmonero-94cc5a7d718a0dc0efe28af8dfc0955c8525a9a1.tar.xz
Merge pull request #37 from tewinget/signals_fix
Fixed console handler not properly exiting on SIGINT and such
-rw-r--r--contrib/epee/include/console_handler.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/epee/include/console_handler.h b/contrib/epee/include/console_handler.h
index 356ee7f9a..ab3cf67c6 100644
--- a/contrib/epee/include/console_handler.h
+++ b/contrib/epee/include/console_handler.h
@@ -233,6 +233,7 @@ namespace epee
void stop()
{
+ m_running = false;
m_stdin_reader.stop();
}
@@ -244,6 +245,10 @@ namespace epee
bool continue_handle = true;
while(continue_handle)
{
+ if (!m_running)
+ {
+ break;
+ }
if (!prompt.empty())
{
epee::log_space::set_console_color(epee::log_space::console_color_yellow, true);
@@ -257,7 +262,7 @@ namespace epee
std::string command;
if(!m_stdin_reader.get_line(command))
{
- LOG_PRINT("Failed to read line. Ignoring and continuing to run, exiting daemon may require a SIGTERM kill.", LOG_LEVEL_0);
+ LOG_PRINT("Failed to read line.", LOG_LEVEL_0);
}
string_tools::trim(command);
@@ -285,6 +290,7 @@ namespace epee
private:
async_stdin_reader m_stdin_reader;
+ bool m_running = true;
};