[dovecot-cvs] dovecot-lda/src deliver.c,1.21,1.22

cras at dovecot.org cras at dovecot.org
Wed Sep 28 14:25:13 EEST 2005


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

Modified Files:
	deliver.c 
Log Message:
Fixed to compile again with lib-signals changes.



Index: deliver.c
===================================================================
RCS file: /var/lib/cvs/dovecot-lda/src/deliver.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- deliver.c	24 Sep 2005 10:24:02 -0000	1.21
+++ deliver.c	28 Sep 2005 11:25:11 -0000	1.22
@@ -60,8 +60,12 @@
 static struct ioloop *ioloop;
 static int return_value = EX_SOFTWARE;
 
-static void sig_quit(int signo __attr_unused__)
+static void sig_die(int signo, void *context __attr_unused__)
 {
+	/* warn about being killed because of some signal, except SIGINT (^C)
+	   which is too common at least while testing :) */
+	if (signo != SIGINT)
+		i_warning("Killed with signal %d", signo);
 	io_loop_stop(ioloop);
 }
 
@@ -418,7 +422,10 @@
 	int i, ret;
 
 	lib_init();
-	lib_init_signals(sig_quit);
+	lib_signals_init();
+        lib_signals_set_handler(SIGINT, TRUE, sig_die, NULL);
+        lib_signals_set_handler(SIGTERM, TRUE, sig_die, NULL);
+        lib_signals_set_handler(SIGPIPE, FALSE, NULL, NULL);
 	ioloop = io_loop_create(default_pool);
 
 	destination = NULL;
@@ -596,6 +603,7 @@
         mail_storage_destroy(storage);
         mail_storage_deinit();
 	io_loop_destroy(ioloop);
+	lib_signals_deinit();
 	lib_deinit();
 
         return EX_OK;



More information about the dovecot-cvs mailing list