[asterisk-commits] file: branch 12 r403312 - /branches/12/main/media_index.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 3 10:37:27 CST 2013


Author: file
Date: Tue Dec  3 10:37:26 2013
New Revision: 403312

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=403312
Log:
media_index: Make media indexing tolerable of bad symlinks.

Media indexing will now skip over files and directories that stat
will not return information about. This can occur under normal
conditions when a symbolic link points to a location that no longer
exists.

Modified:
    branches/12/main/media_index.c

Modified: branches/12/main/media_index.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/main/media_index.c?view=diff&rev=403312&r1=403311&r2=403312
==============================================================================
--- branches/12/main/media_index.c (original)
+++ branches/12/main/media_index.c Tue Dec  3 10:37:26 2013
@@ -551,9 +551,8 @@
 		ast_str_set(&statfile, 0, "%s/%s", ast_str_buffer(index_dir), dent->d_name);
 
 		if (stat(ast_str_buffer(statfile), &st) < 0) {
-			ast_log(LOG_ERROR, "Failed to stat %s: %s\n", ast_str_buffer(statfile), strerror(errno));
-			res = -1;
-			break;
+			ast_log(LOG_WARNING, "Failed to stat %s: %s\n", ast_str_buffer(statfile), strerror(errno));
+			continue;
 		}
 
 		if (S_ISDIR(st.st_mode)) {




More information about the asterisk-commits mailing list