[svn-commits] jpeeler: branch 1.6.2 r251632 - in /branches/1.6.2: ./ main/abstract_jb.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Mar 10 12:26:39 CST 2010


Author: jpeeler
Date: Wed Mar 10 12:26:35 2010
New Revision: 251632

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=251632
Log:
Merged revisions 251631 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r251631 | jpeeler | 2010-03-10 12:25:18 -0600 (Wed, 10 Mar 2010) | 14 lines
  
  Fix jitterbuffer logging not creating logfiles.
  
  Three changes made here:
  1) Do not fail if a previous log does not exist (in fact, this is probably
  expected).
  2) Ensure that the file descriptor to write to gets assigned properly. I am at
  a loss as to why assigning safe_fd outside the if fixes this, but it makes
  the if statement slightly less complicated anyway.
  3) Move up the failure message so that the errno of the failure is not
  overwritten by fclose.
  
  (closes issue #16917)
  Reported by: Artem
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/main/abstract_jb.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/main/abstract_jb.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/main/abstract_jb.c?view=diff&rev=251632&r1=251631&r2=251632
==============================================================================
--- branches/1.6.2/main/abstract_jb.c (original)
+++ branches/1.6.2/main/abstract_jb.c Wed Mar 10 12:26:35 2010
@@ -499,12 +499,14 @@
 
 		snprintf(logfile_pathname, sizeof(logfile_pathname),
 			"/tmp/ast_%s_jb_%s--%s.log", jbimpl->name, name1, name2);
-		if (!(safe_fd = mkstemp(safe_logfile)) > -1 || unlink(logfile_pathname) || link(safe_logfile, logfile_pathname) || unlink(safe_logfile) || !(jb->logfile = fdopen(safe_fd, "w+b"))) {
+		unlink(logfile_pathname);
+		safe_fd = mkstemp(safe_logfile);
+		if (safe_fd < 0 || link(safe_logfile, logfile_pathname) || unlink(safe_logfile) || !(jb->logfile = fdopen(safe_fd, "w+b"))) {
+			ast_log(LOG_ERROR, "Failed to create frame log file with pathname '%s': %s\n", logfile_pathname, strerror(errno));
 			jb->logfile = NULL;
 			if (safe_fd > -1) {
 				close(safe_fd);
 			}
-			ast_log(LOG_ERROR, "Failed to create frame log file with pathname '%s': %s\n", logfile_pathname, strerror(errno));
 		}
 
 		if (res == JB_IMPL_OK) {




More information about the svn-commits mailing list