[dovecot-cvs] dovecot/src/master main.c,1.80.2.16,1.80.2.17

tss at dovecot.org tss at dovecot.org
Sat Jan 27 01:44:27 UTC 2007


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

Modified Files:
      Tag: branch_1_0
	main.c 
Log Message:
Added --log-error command line option.



Index: main.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/master/main.c,v
retrieving revision 1.80.2.16
retrieving revision 1.80.2.17
diff -u -d -r1.80.2.16 -r1.80.2.17
--- main.c	25 Jan 2007 14:58:46 -0000	1.80.2.16
+++ main.c	27 Jan 2007 01:44:25 -0000	1.80.2.17
@@ -562,7 +562,7 @@
 	(void)close(fd);
 }
 
-static void main_init(void)
+static void main_init(bool log_error)
 {
 	/* deny file access from everyone else except owner */
         (void)umask(0077);
@@ -580,6 +580,9 @@
 
 	log_init();
 
+	if (log_error)
+		i_fatal("This is Dovecot's error log");
+
 	lib_signals_init();
         lib_signals_set_handler(SIGINT, TRUE, sig_die, NULL);
         lib_signals_set_handler(SIGTERM, TRUE, sig_die, NULL);
@@ -752,7 +755,7 @@
 {
 	/* parse arguments */
 	const char *exec_protocol = NULL, *exec_section = NULL, *user, *home;
-	bool foreground = FALSE, ask_key_pass = FALSE;
+	bool foreground = FALSE, ask_key_pass = FALSE, log_error = FALSE;
 	bool dump_config = FALSE, dump_config_nondefaults = FALSE;
 	int i;
 
@@ -793,6 +796,9 @@
 		} else if (strcmp(argv[i], "--build-options") == 0) {
 			print_build_options();
 			return 0;
+		} else if (strcmp(argv[i], "--log-error") == 0) {
+			log_error = TRUE;
+			foreground = TRUE;
 		} else {
 			print_help();
 			i_fatal("Unknown argument: %s", argv[1]);
@@ -866,7 +872,7 @@
 
 	ioloop = io_loop_create(system_pool);
 
-	main_init();
+	main_init(log_error);
         io_loop_run(ioloop);
 	main_deinit();
 



More information about the dovecot-cvs mailing list