diff options
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/command_server.cpp | 4 | ||||
-rw-r--r-- | src/daemon/command_server.h | 2 | ||||
-rw-r--r-- | src/daemon/daemon.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/daemon/command_server.cpp b/src/daemon/command_server.cpp index 5510ee594..65bceff75 100644 --- a/src/daemon/command_server.cpp +++ b/src/daemon/command_server.cpp @@ -196,11 +196,11 @@ bool t_command_server::process_command_vec(const std::vector<std::string>& cmd) return result; } -bool t_command_server::start_handling() +bool t_command_server::start_handling(std::function<void(void)> exit_handler) { if (m_is_rpc) return false; - m_command_lookup.start_handling("", get_commands_str()); + m_command_lookup.start_handling("", get_commands_str(), exit_handler); return true; } diff --git a/src/daemon/command_server.h b/src/daemon/command_server.h index aa8e0770e..5df457288 100644 --- a/src/daemon/command_server.h +++ b/src/daemon/command_server.h @@ -62,7 +62,7 @@ public: bool process_command_vec(const std::vector<std::string>& cmd); - bool start_handling(); + bool start_handling(std::function<void(void)> exit_handler = NULL); void stop_handling(); diff --git a/src/daemon/daemon.cpp b/src/daemon/daemon.cpp index 7931ba03f..2bd592611 100644 --- a/src/daemon/daemon.cpp +++ b/src/daemon/daemon.cpp @@ -126,7 +126,7 @@ bool t_daemon::run(bool interactive) if (interactive) { rpc_commands = new daemonize::t_command_server(0, 0, false, mp_internals->rpc.get_server()); - rpc_commands->start_handling(); + rpc_commands->start_handling(std::bind(&daemonize::t_daemon::stop, this)); } mp_internals->p2p.run(); // blocks until p2p goes down |