[Asterisk-cvs] asterisk logger.c,1.75,1.76

kpfleming at lists.digium.com kpfleming at lists.digium.com
Tue Jul 5 16:22:40 CDT 2005


Update of /usr/cvsroot/asterisk
In directory localhost.localdomain:/tmp/cvs-serv1156

Modified Files:
	logger.c 
Log Message:
ensure that filesize-triggered reloads don't recurse (bug #4621, with mods)


Index: logger.c
===================================================================
RCS file: /usr/cvsroot/asterisk/logger.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- logger.c	6 Jun 2005 22:12:18 -0000	1.75
+++ logger.c	5 Jul 2005 20:31:34 -0000	1.76
@@ -64,7 +64,7 @@
 
 AST_MUTEX_DEFINE_STATIC(msglist_lock);
 AST_MUTEX_DEFINE_STATIC(loglock);
-static int pending_logger_reload = 0;
+static int filesize_reload_needed = 0;
 static int global_logmask = -1;
 
 static struct {
@@ -439,6 +439,8 @@
 
 	ast_mutex_unlock(&loglock);
 
+	filesize_reload_needed = 0;
+
 	queue_log_init();
 	init_logger_chain();
 
@@ -451,7 +453,6 @@
 		} else 
 			ast_log(LOG_ERROR, "Unable to create event log: %s\n", strerror(errno));
 	}
-	pending_logger_reload = 0;
 	return -1;
 }
 
@@ -549,7 +550,7 @@
 static int handle_SIGXFSZ(int sig) 
 {
 	/* Indicate need to reload */
-	pending_logger_reload = 1;
+	filesize_reload_needed = 1;
 	return 0;
 }
 
@@ -780,7 +781,7 @@
 
 	ast_mutex_unlock(&loglock);
 	/* end critical section */
-	if (pending_logger_reload) {
+	if (filesize_reload_needed) {
 		reload_logger(1);
 		ast_log(LOG_EVENT,"Rotated Logs Per SIGXFSZ (Exceeded file size limit)\n");
 		if (option_verbose)




More information about the svn-commits mailing list