[Asterisk-code-review] res musiconhold: Remove 'special' MP3 modes (asterisk[master])

Kevin Harwell asteriskteam at digium.com
Fri Jul 14 10:47:18 CDT 2017


Kevin Harwell has posted comments on this change. ( https://gerrit.asterisk.org/5995 )

Change subject: res_musiconhold: Remove 'special' MP3 modes
......................................................................


Patch Set 1: Code-Review-1

(1 comment)

https://gerrit.asterisk.org/#/c/5995/1/res/res_musiconhold.c
File res/res_musiconhold.c:

https://gerrit.asterisk.org/#/c/5995/1/res/res_musiconhold.c@575
PS1, Line 575: struct dirent *de;
             : 		DIR *dir = opendir(class->dir);
             : 
             : 		if (!dir) {
             : 			ast_log(LOG_WARNING, "Cannot access '%s': %s\n", class->dir, strerror(errno));
             : 			return -1;
             : 		}
             : 
             : 		while ((de = readdir(dir)) && (files < MAX_FILE_COUNT)) {
             : 			if (strlen(de->d_name) > 3 &&
             : 			    (ast_ends_with(de->d_name, ".raw") ||
             : 				 ast_ends_with(de->d_name, ".sln") ||
             : 				 ast_ends_with(de->d_name, ".mp3"))) {
I'd suggest using 'ast_file_read_dirs' (file.h) here instead of calling opendir directly. It's more portable and thread safe.



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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I865fbee781c36f9cf9f6b5076f95f60b34fa7d64
Gerrit-Change-Number: 5995
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Comment-Date: Fri, 14 Jul 2017 15:47:18 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170714/1869f5ed/attachment.html>


More information about the asterisk-code-review mailing list