diff --git a/src/ebusd/main.cpp b/src/ebusd/main.cpp index ff066960..afcd37e1 100644 --- a/src/ebusd/main.cpp +++ b/src/ebusd/main.cpp @@ -669,11 +669,11 @@ void signalHandler(int sig) { break; case SIGINT: logNotice(lf_main, "SIGINT received"); - shutdown(); + s_mainLoop->join(); break; case SIGTERM: logNotice(lf_main, "SIGTERM received"); - shutdown(); + s_mainLoop->join(); break; default: logNotice(lf_main, "undefined signal %s", strsignal(sig)); diff --git a/src/ebusd/mainloop.cpp b/src/ebusd/mainloop.cpp index ce809683..333a719b 100644 --- a/src/ebusd/mainloop.cpp +++ b/src/ebusd/mainloop.cpp @@ -100,7 +100,7 @@ result_t UserList::addFromFile(map& row, vector< mapopen(); if (result != RESULT_OK) { diff --git a/src/ebusd/mainloop.h b/src/ebusd/mainloop.h index f0c3c23d..d9d558d2 100644 --- a/src/ebusd/mainloop.h +++ b/src/ebusd/mainloop.h @@ -112,6 +112,11 @@ class MainLoop : public Thread, DeviceListener { */ ~MainLoop(); + /** + * Shutdown the main loop. + */ + void shutdown() { m_shutdown = true; } + /** * Get the @a BusHandler instance. * @return the created @a BusHandler instance.