From ee765f1469ecb4ac666139340928f35b39926f36 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Thu, 5 Nov 2026 16:05:29 +0100 Subject: Install signal handlers before the first thread is spawned --- src/opentracker.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/opentracker.c b/src/opentracker.c index 8de3fc1..f0841ff 100644 --- a/src/opentracker.c +++ b/src/opentracker.c @@ -410,6 +410,10 @@ int main(int argc, char **argv) { if (event_add(g_self_pipe[0], EVENT_IN, fdstate_open(g_self_pipe[0], (void *)FLAG_SELFPIPE, 0)) == -1) panic("selfpipe event_add"); + /* Before any thread exists, so none of them runs with a signal still at its + default disposition */ + install_signal_handlers(); + /* Init all sub systems. This call may fail with an exit() */ trackerlogic_init(); @@ -422,8 +426,6 @@ int main(int argc, char **argv) { if (g_statefile) load_state(g_statefile); - install_signal_handlers(); - listen_start_tcp_workers(); listen_start_udp_workers(); -- cgit v1.3