Handle signals without C API

pull/1314/head
Stephen Shelton 4 years ago
parent b5d6a73ffd
commit ec4109ae60
No known key found for this signature in database
GPG Key ID: EE4BADACCE8B631C

@ -6,6 +6,7 @@
#include <util/logging/logger.hpp>
#include <util/logging/ostream_logger.hpp>
#include <util/str.hpp>
#include <util/thread/logic.hpp>
#include <csignal>
@ -53,10 +54,10 @@ std::promise<int> exit_code;
void
handle_signal(int sig)
{
// TODO: handle this without C API
(void)sig;
LogError("FIXME: handle signal");
abort();
if (ctx)
LogicCall(ctx->logic, std::bind(&llarp::Context::HandleSignal, ctx.get(), sig));
else
std::cerr << "Received signal " << sig << ", but have no context yet. Ignoring!" << std::endl;
}
#ifdef _WIN32

Loading…
Cancel
Save