]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
automerge commit
authorAutomerge script <automerge@asterisk.org>
Wed, 14 Jun 2006 03:04:51 +0000 (03:04 +0000)
committerAutomerge script <automerge@asterisk.org>
Wed, 14 Jun 2006 03:04:51 +0000 (03:04 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@34021 65c4cc65-6c06-0410-ace0-fbb531ad65f3

file.c

diff --git a/file.c b/file.c
index 76d848f79334f51b4d1d453e94ba471f239e12d5..6bbfc60ab1666775ea2184f4cdf13f1d37d1cfb0 100644 (file)
--- 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;