From 0f95c7d1056cab5bd8c6334cf601349ac4631457 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Thu, 29 Oct 2026 00:53:50 +0100 Subject: Revert last wake-up experiment. Having each udp worker wake up once a second to check if the tracker stops is wasteful --- opentracker.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'opentracker.c') diff --git a/opentracker.c b/opentracker.c index ab4a934..e0f16d7 100644 --- a/opentracker.c +++ b/opentracker.c @@ -49,7 +49,9 @@ static void panic(const char *routine) { exit(111); } -/* Say we are stopping, wake the loop, and let main do the work on its own stack. */ +/* Say we are stopping, wake the loop, and let main do the work on its own + stack. Everything other than SIGINT falls through and does nothing, which + is what OT_SIGNAL_WAKE wants: returning from the read is all it is for. */ static void signal_handler(int s) { if (s == SIGINT) { const char byte = 0; @@ -85,7 +87,8 @@ static void install_signal_handlers(void) { sa.sa_handler = signal_handler; sigemptyset(&sa.sa_mask); sa.sa_flags = 0; - if ((sigaction(SIGINT, &sa, NULL) == -1) || (sigaction(SIGALRM, &sa, NULL) == -1)) + if ((sigaction(SIGINT, &sa, NULL) == -1) || (sigaction(SIGALRM, &sa, NULL) == -1) || + (sigaction(OT_SIGNAL_WAKE, &sa, NULL) == -1)) panic("install_signal_handlers"); sigaddset(&signal_mask, SIGINT); -- cgit v1.3