mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-11-04 05:15:22 +00:00 
			
		
		
		
	cli: Remove silly usage of RAII_VAR.
Change-Id: I81aacfee7cd26e4fc5eef07bca582700c2975bd7
This commit is contained in:
		@@ -959,7 +959,7 @@ static char *handle_chanlist(struct ast_cli_entry *e, int cmd, struct ast_cli_ar
 | 
			
		||||
#define VERBOSE_FORMAT_STRING  "%-20.20s %-20.20s %-16.16s %4d %-7.7s %-12.12s %-25.25s %-15.15s %8.8s %-11.11s %-11.11s %-20.20s\n"
 | 
			
		||||
#define VERBOSE_FORMAT_STRING2 "%-20.20s %-20.20s %-16.16s %-4.4s %-7.7s %-12.12s %-25.25s %-15.15s %8.8s %-11.11s %-11.11s %-20.20s\n"
 | 
			
		||||
 | 
			
		||||
	RAII_VAR(struct ao2_container *, channels, NULL, ao2_cleanup);
 | 
			
		||||
	struct ao2_container *channels;
 | 
			
		||||
	struct ao2_iterator it_chans;
 | 
			
		||||
	struct stasis_message *msg;
 | 
			
		||||
	int numchans = 0, concise = 0, verbose = 0, count = 0;
 | 
			
		||||
@@ -1073,6 +1073,7 @@ static char *handle_chanlist(struct ast_cli_entry *e, int cmd, struct ast_cli_ar
 | 
			
		||||
 | 
			
		||||
		ast_cli(a->fd, "%d call%s processed\n", ast_processed_calls(), ESS(ast_processed_calls()));
 | 
			
		||||
	}
 | 
			
		||||
	ao2_ref(channels, -1);
 | 
			
		||||
 | 
			
		||||
	return CLI_SUCCESS;
 | 
			
		||||
 | 
			
		||||
@@ -1685,7 +1686,7 @@ char *ast_cli_complete(const char *word, const char * const choices[], int state
 | 
			
		||||
char *ast_complete_channels(const char *line, const char *word, int pos, int state, int rpos)
 | 
			
		||||
{
 | 
			
		||||
	int wordlen = strlen(word), which = 0;
 | 
			
		||||
	RAII_VAR(struct ao2_container *, cached_channels, NULL, ao2_cleanup);
 | 
			
		||||
	struct ao2_container *cached_channels;
 | 
			
		||||
	char *ret = NULL;
 | 
			
		||||
	struct ao2_iterator iter;
 | 
			
		||||
	struct stasis_message *msg;
 | 
			
		||||
@@ -1709,6 +1710,7 @@ char *ast_complete_channels(const char *line, const char *word, int pos, int sta
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	ao2_iterator_destroy(&iter);
 | 
			
		||||
	ao2_ref(cached_channels, -1);
 | 
			
		||||
 | 
			
		||||
	return ret;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user