aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-02-03 05:35:03 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-02-03 05:35:03 +0000
commitf18b92c3e323261f7b8a99e3cbf27063be5f9c3e (patch)
treee2bedf4509eac012cde7a746a56141c5bf86dd4e /file.c
parent2d24c69f9a1a3d34251d3f2c4ab9523c3be94a82 (diff)
Fix wav append mode (bug #3498)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4958 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'file.c')
-rwxr-xr-xfile.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/file.c b/file.c
index 4213f5e31..f0761b15e 100755
--- a/file.c
+++ b/file.c
@@ -855,8 +855,12 @@ struct ast_filestream *ast_writefile(const char *filename, const char *type, con
return NULL;
}
/* set the O_TRUNC flag if and only if there is no O_APPEND specified */
- if (!(flags & O_APPEND))
+ if (flags & O_APPEND) {
+ /* We really can't use O_APPEND as it will break WAV header updates */
+ flags &= ~O_APPEND;
+ } else {
myflags = O_TRUNC;
+ }
myflags |= O_WRONLY | O_CREAT;