From f408d1dd2f79bc8c7e765af56c8b023e95e21046 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 10 May 2008 11:02:53 +0200 Subject: [PATCH] sn-evolution: Add a SIGTERM handler. --- src/sn-evolution.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sn-evolution.c b/src/sn-evolution.c index 7ba44df..ffe5c34 100644 --- a/src/sn-evolution.c +++ b/src/sn-evolution.c @@ -280,6 +280,7 @@ static int evolution_start (int threads_num) int main (int argc, char **argv) { struct sigaction sigint_action; + struct sigaction sigterm_action; read_options (argc, argv); if (initial_input_file == NULL) @@ -289,6 +290,10 @@ int main (int argc, char **argv) sigint_action.sa_handler = sigint_handler; sigaction (SIGINT, &sigint_action, NULL); + memset (&sigterm_action, '\0', sizeof (sigterm_action)); + sigterm_action.sa_handler = sigint_handler; + sigaction (SIGTERM, &sigterm_action, NULL); + population = sn_population_create (max_population_size); if (population == NULL) { -- 2.11.0