[asterisk-commits] tilghman: trunk r131166 - /trunk/main/logger.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 15 19:52:48 CDT 2008


Author: tilghman
Date: Tue Jul 15 19:52:48 2008
New Revision: 131166

URL: http://svn.digium.com/view/asterisk?view=rev&rev=131166
Log:
Fix rotate strategy
(Closes issue #13086)

Modified:
    trunk/main/logger.c

Modified: trunk/main/logger.c
URL: http://svn.digium.com/view/asterisk/trunk/main/logger.c?view=diff&rev=131166&r1=131165&r2=131166
==============================================================================
--- trunk/main/logger.c (original)
+++ trunk/main/logger.c Tue Jul 15 19:52:48 2008
@@ -533,19 +533,19 @@
 			for (which = 0; which < ARRAY_LEN(suffixes); which++) {
 				snprintf(new, sizeof(new), "%s.%d%s", filename, x, suffixes[which]);
 				fd = open(new, O_RDONLY);
-				if (fd > -1)
+				if (fd > -1) {
 					close(fd);
-				else {
 					found = 1;
 					break;
 				}
 			}
-			if (!found)
+			if (!found) {
 				break;
+			}
 		}
 
 		/* Found an empty slot */
-		for (y = x; y > -1; y--) {
+		for (y = x; y > 0; y--) {
 			for (which = 0; which < ARRAY_LEN(suffixes); which++) {
 				snprintf(old, sizeof(old), "%s.%d%s", filename, y - 1, suffixes[which]);
 				fd = open(old, O_RDONLY);




More information about the asterisk-commits mailing list