[dovecot-cvs] dovecot/src/lib lib-signals.c,1.7,1.8

cras at dovecot.org cras at dovecot.org
Thu Jun 9 21:29:00 EEST 2005


Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv6322/lib

Modified Files:
	lib-signals.c 
Log Message:
Ignore SIGALRM, but not with SIG_IGN as it causes syscalls to restart.



Index: lib-signals.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/lib-signals.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- lib-signals.c	12 Nov 2004 14:35:39 -0000	1.7
+++ lib-signals.c	9 Jun 2005 18:28:57 -0000	1.8
@@ -73,10 +73,19 @@
 		if (errno != EINTR)
 			i_fatal("sigaction(): %m");
 	}
+
+	/* we want to just ignore SIGALRM, but to get it to abort syscalls
+	   with EINTR we can't just set it to SIG_IGN. sig_counter handler
+	   is good enough. */
+	while (sigaction(SIGALRM, &act, NULL) < 0) {
+		if (errno != EINTR)
+			i_fatal("sigaction(): %m");
+	}
 #else
         signal(SIGHUP, sig_counter);
         signal(SIGUSR1, sig_counter);
         signal(SIGUSR2, sig_counter);
+        signal(SIGALRM, sig_counter);
 #endif
 
 	/* these signals should be called only once, so it's safe to use
@@ -84,5 +93,4 @@
 	signal(SIGINT, sig_quit);
         signal(SIGTERM, sig_quit);
         signal(SIGPIPE, SIG_IGN);
-        signal(SIGALRM, SIG_IGN);
 }



More information about the dovecot-cvs mailing list