]> git.sommitrealweird.co.uk Git - onak.git/blobdiff - cleanup.c
Fix path bug in sendkeysync.
[onak.git] / cleanup.c
index 3a33e60c2ef88c4daaae7867bd50068133080da4..ecb33220db942b9c0fa1c84dfc8c80149dfcb700 100644 (file)
--- a/cleanup.c
+++ b/cleanup.c
@@ -65,17 +65,13 @@ void sig_cleanup(int signal)
  */
 void catchsignals(void)
 {
  */
 void catchsignals(void)
 {
-       struct sigaction alarmh;
-
        logthing(LOGTHING_INFO, "Catching signals");
 
        logthing(LOGTHING_INFO, "Catching signals");
 
-       memset(&alarmh, 0, sizeof(alarmh));
-       alarmh.sa_handler = sig_cleanup;
-       sigaction(SIGALRM, &alarmh, NULL);
-       sigaction(SIGPIPE, &alarmh, NULL);
-       sigaction(SIGTERM, &alarmh, NULL);
-       sigaction(SIGINT, &alarmh, NULL);
-       sigaction(SIGHUP, &alarmh, NULL);
+       signal(SIGALRM, &sig_cleanup);
+       signal(SIGPIPE, &sig_cleanup);
+       signal(SIGTERM, &sig_cleanup);
+       signal(SIGINT, &sig_cleanup);
+       signal(SIGHUP, &sig_cleanup);
 
        return;
 }
 
        return;
 }