[Freeswitch-trunk] [commit] r6838 - freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv

Freeswitch SVN anthm at freeswitch.org
Mon Dec 17 12:48:13 EST 2007


Author: anthm
Date: Mon Dec 17 12:48:13 2007
New Revision: 6838

Modified:
   freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c

Log:
tweak for MODEVENT-6

Modified: freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c	Mon Dec 17 12:48:13 2007
@@ -146,7 +146,7 @@
 		}
 		
 		if ((bytes_in = write(fd->fd, log_line, bytes_out)) != bytes_out) {
-			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Write error to file %s\n", path);
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Write error to file %s %d/%d\n", path, (int)bytes_in, (int)bytes_out);
 		}
 		fd->bytes += bytes_in;
 		switch_mutex_unlock(fd->mutex);
@@ -337,7 +337,9 @@
 		for (hi = switch_hash_first(NULL, globals.fd_hash); hi; hi = switch_hash_next(hi)) {
 			switch_hash_this(hi, NULL, NULL, &val);
 			fd = (cdr_fd_t *) val;
+			switch_mutex_lock(fd->mutex);
 			do_rotate(fd);
+			switch_mutex_unlock(fd->mutex);
 		}
 	}
 }



More information about the Freeswitch-trunk mailing list