]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
tweak for MODEVENT-6
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 17 Dec 2007 17:48:13 +0000 (17:48 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 17 Dec 2007 17:48:13 +0000 (17:48 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6838 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c

index 4d3deca02a9a05f843d2a7fc53c0e375fea6152c..c57123b265cd1ede451ceb1163bbea7c7b27e7a6 100644 (file)
@@ -146,7 +146,7 @@ static void write_cdr(const char *path, const char *log_line)
                }
                
                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 @@ static void event_handler(switch_event_t *event)
                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);
                }
        }
 }