]> git.sommitrealweird.co.uk Git - onak.git/blobdiff - cleanup.c
Always put a leading 0x on keyids in HTML output links
[onak.git] / cleanup.c
index 3a33e60c2ef88c4daaae7867bd50068133080da4..97d02c548bec9b27fbae1449bb59579930dc0bee 100644 (file)
--- a/cleanup.c
+++ b/cleanup.c
@@ -1,9 +1,20 @@
 /*
  * cleanup.c - Cleanup and shutdown framework.
  *
 /*
  * cleanup.c - Cleanup and shutdown framework.
  *
- * Jonathan McDowell <noodles@earth.li>
+ * Copyright 2004 Jonathan McDowell <noodles@earth.li>
  *
  *
- * Copyright 2004 Project Purple
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
 #include <signal.h>
  */
 
 #include <signal.h>
@@ -65,17 +76,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;
 }