diff --git a/src/main.c b/src/main.c
index 3dd7b6b94b338948b149fb0afe37ae43d39112fd..c00b7ad68b6d358bd4fba2e5cd1f5442e8446c99 100644 (file)
--- a/src/main.c
+++ b/src/main.c
exit(EXIT_SUCCESS);
}
+void
+catch_sighup( int sig)
+{
+ printf("\n%s\n", _("Exiting..."));
+ exit(EXIT_SUCCESS);
+}
+
void
catch_sigcont( int sig )
{
perror("sigaction(SIGCONT)");
exit(EXIT_FAILURE);
}
-
+
+ /* setup signal behaviour - SIGHUP*/
+ sigemptyset( &act.sa_mask );
+ act.sa_flags = 0;
+ act.sa_handler = catch_sigint;
+ if( sigaction(SIGHUP, &act, NULL)<0 )
+ {
+ perror("sigaction(SIGHUP)");
+ exit(EXIT_FAILURE);
+ }
+
/* install exit function */
atexit(exit_and_cleanup);