diff --git a/daemon/main.cpp b/daemon/main.cpp index 3b0fb75ff..3c4f6f2bd 100644 --- a/daemon/main.cpp +++ b/daemon/main.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include @@ -53,10 +54,10 @@ std::promise 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