aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-14 02:20:22 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-14 02:20:22 +0000
commitc57a974d7160049b5d1030a891e54e2e43c391a4 (patch)
tree59d03be791ef7e923a9fa86816fd06a9d53657ed
parent39003a10e24a6e2697f5a057619fab676708f7fb (diff)
don't output 'no format found' when we _did_ find the format but couldn't open the desired file for some other reason
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@33993 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--file.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/file.c b/file.c
index 76d848f79..6bbfc60ab 100644
--- a/file.c
+++ b/file.c
@@ -881,6 +881,7 @@ struct ast_filestream *ast_writefile(const char *filename, const char *type, con
char *fn, *orig_fn = NULL;
char *buf = NULL;
size_t size = 0;
+ int format_found = 0;
if (ast_mutex_lock(&formatlock)) {
ast_log(LOG_WARNING, "Unable to lock format list\n");
@@ -900,6 +901,8 @@ struct ast_filestream *ast_writefile(const char *filename, const char *type, con
for (f = formats; f && !fs; f = f->next) {
if (!exts_compare(f->exts, type))
continue;
+ else
+ format_found = 1;
fn = build_filename(filename, type);
fd = open(fn, flags | myflags, mode);
@@ -980,7 +983,8 @@ struct ast_filestream *ast_writefile(const char *filename, const char *type, con
}
ast_mutex_unlock(&formatlock);
- if (!fs)
+
+ if (!format_found)
ast_log(LOG_WARNING, "No such format '%s'\n", type);
return fs;