aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-07 14:47:36 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-07 14:47:36 +0000
commit713365557dee6a718873fe924af7f1b6bbd7b3aa (patch)
tree67cf8aadcb2731da3228162c3063c802c7a758bf /file.c
parent80163cc68bd4fb1f6d128b148760e8933cb106e1 (diff)
Bug 6161 - Remove duplicated code
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7850 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'file.c')
-rw-r--r--file.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/file.c b/file.c
index 41da9faf3..590fb71f0 100644
--- a/file.c
+++ b/file.c
@@ -365,13 +365,9 @@ static int ast_filehelper(const char *filename, const char *filename2, const cha
/* Check for a specific format */
if (ast_mutex_lock(&formatlock)) {
ast_log(LOG_WARNING, "Unable to lock format list\n");
- if (action == ACTION_EXISTS)
- return 0;
- else
- return -1;
+ return res;
}
- f = formats;
- while(f) {
+ for (f = formats; f; f = f->next) {
if (!fmt || exts_compare(f->exts, fmt)) {
char *stringp=NULL;
exts = ast_strdupa(f->exts);
@@ -452,7 +448,6 @@ static int ast_filehelper(const char *filename, const char *filename2, const cha
} while(ext);
}
- f = f->next;
}
ast_mutex_unlock(&formatlock);
if ((action == ACTION_EXISTS) || (action == ACTION_OPEN))