]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix wav append mode (bug #3498)
authorRussell Bryant <russell@russellbryant.com>
Mon, 7 Feb 2005 03:53:36 +0000 (03:53 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 7 Feb 2005 03:53:36 +0000 (03:53 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@4975 65c4cc65-6c06-0410-ace0-fbb531ad65f3

file.c

diff --git a/file.c b/file.c
index 034fe1fb08c8e758eb7767c50bccfb78be87ead6..433edaeab06e85abc2c0d55cfb1ff3004fd4d85e 100755 (executable)
--- a/file.c
+++ b/file.c
@@ -844,8 +844,12 @@ struct ast_filestream *ast_writefile(char *filename, char *type, char *comment,
                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;