From: Florian Forster Date: Sat, 10 May 2008 09:02:53 +0000 (+0200) Subject: sn-evolution: Add a SIGTERM handler. X-Git-Tag: v1.0.0~93 X-Git-Url: https://git.octo.it/?p=sort-networks.git;a=commitdiff_plain;h=f408d1dd2f79bc8c7e765af56c8b023e95e21046 sn-evolution: Add a SIGTERM handler. --- 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) {