[Asterisk-code-review] ARI: Deleting log channels (asterisk[13])

Ashley Sanders asteriskteam at digium.com
Thu Aug 6 16:07:08 CDT 2015


Ashley Sanders has posted comments on this change.

Change subject: ARI: Deleting log channels
......................................................................


Patch Set 3: Code-Review-1

(1 comment)

https://gerrit.asterisk.org/#/c/1048/3/main/logger.c
File main/logger.c:

Line 1106: int ast_logger_remove_channel(const char *log_channel)
         : {
         : 	struct logchannel *chan;
         : 	struct ast_str *filename = ast_str_create(64);
         : 
         : 	if (!filename) {
         : 		return -1;
         : 	}
         : 
         : 	ast_str_append(&filename, 0, "%s/%s", ast_config_AST_LOG_DIR, log_channel);
         : 
         : 	AST_RWLIST_WRLOCK(&logchannels);
         : 	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&logchannels, chan, list) {
         : 		if (chan->dynamic && !strcmp(chan->filename, ast_str_buffer(filename))) {
         : 			AST_RWLIST_REMOVE_CURRENT(list);
         : 			break;
         : 		}
         : 	}
         : 	AST_RWLIST_TRAVERSE_SAFE_END;
         : 	AST_RWLIST_UNLOCK(&logchannels);
         : 
         : 	if (!chan) {
         : 		return 1;
         : 	}
         : 
         : 	if (chan->fileptr) {
         : 		fclose(chan->fileptr);
         : 		chan->fileptr = NULL;
         : 	}
         : 	ast_free(chan);
         : 	chan = NULL;
         : 
         : 	return 0;
         : }
Same here... return a constant or an enum.


-- 
To view, visit https://gerrit.asterisk.org/1048
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id6eeb54ebcc511595f0418d586ff55914bc3aae6
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Scott Emidy <jemidy at digium.com>
Gerrit-Reviewer: Ashley Sanders <asanders at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list