From 6eca96c65740e88606c2f444f7a17b10b0e3945d Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Thu, 3 Feb 2005 05:35:03 +0000 Subject: [PATCH] Fix wav append mode (bug #3498) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4958 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- file.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/file.c b/file.c index 4213f5e31a..f0761b15ef 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;