From f8bfe3a550224669199e18aedec0df5f3c5565b7 Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Tue, 28 Apr 2015 14:50:54 -0700 Subject: [PATCH] Terminate process on SIGINT in all cases --- src/ripple/app/main/Application.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ripple/app/main/Application.cpp b/src/ripple/app/main/Application.cpp index d417c52443..75f7681859 100644 --- a/src/ripple/app/main/Application.cpp +++ b/src/ripple/app/main/Application.cpp @@ -414,7 +414,7 @@ public: , m_entropyTimer (this) - , m_signals(get_io_service(), SIGINT) + , m_signals (get_io_service()) , m_resolver (ResolverAsio::New (get_io_service(), m_logs.journal("Resolver"))) @@ -677,9 +677,11 @@ public: // VFALCO NOTE: 0 means use heuristics to determine the thread count. m_jobQueue->setThreadCount (0, getConfig ().RUN_STANDALONE); + // We want to intercept and wait for CTRL-C to terminate the process + m_signals.add (SIGINT); + m_signals.async_wait(std::bind(&ApplicationImp::signalled, this, - std::placeholders::_1, - std::placeholders::_2)); + std::placeholders::_1, std::placeholders::_2)); assert (mTxnDB == nullptr); @@ -1403,7 +1405,7 @@ static void addTxnSeqField () Blob txnMeta; soci::statement st = - (session.prepare << + (session.prepare << "SELECT TransID, TxnMeta FROM Transactions;", soci::into(strTransId), soci::into(sociTxnMetaBlob, tmi));