mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-11-03 20:38:59 +00:00 
			
		
		
		
	Fix rotate strategy
(Closes issue #13086) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@131166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		@@ -533,19 +533,19 @@ static int rotate_file(const char *filename)
 | 
			
		||||
			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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user