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

Loading…
Cancel
Save