From 2ddd45e5e17e1d3c43cc97cb5a1aecaa338082e9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 4 Jun 2018 17:42:47 +0200 Subject: [PATCH] test/run_neighbor_explorer: use ShutdownHandler to catch SIGINT/SIGTERM --- Makefile.am | 1 + test/run_neighbor_explorer.cxx | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Makefile.am b/Makefile.am index 1c5d38e31..1550576ec 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1967,6 +1967,7 @@ if ENABLE_NEIGHBOR_PLUGINS test_run_neighbor_explorer_SOURCES = \ src/Log.cxx src/LogBackend.cxx \ + test/ShutdownHandler.cxx test/ShutdownHandler.hxx \ test/run_neighbor_explorer.cxx test_run_neighbor_explorer_LDADD = $(AM_LDADD) \ $(NEIGHBOR_LIBS) \ diff --git a/test/run_neighbor_explorer.cxx b/test/run_neighbor_explorer.cxx index 770bf1956..1d48036d3 100644 --- a/test/run_neighbor_explorer.cxx +++ b/test/run_neighbor_explorer.cxx @@ -24,6 +24,7 @@ #include "neighbor/Glue.hxx" #include "fs/Path.hxx" #include "event/Loop.hxx" +#include "ShutdownHandler.hxx" #include "Log.hxx" #include @@ -68,6 +69,7 @@ try { GlobalInit init; EventLoop loop; + const ShutdownHandler shutdown_handler(loop); /* read configuration file (mpd.conf) */