Merged revisions 330204 via svnmerge from
authorSean Bright <sean@malleable.com>
Fri, 29 Jul 2011 17:02:11 +0000 (17:02 +0000)
committerSean Bright <sean@malleable.com>
Fri, 29 Jul 2011 17:02:11 +0000 (17:02 +0000)
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r330204 | seanbright | 2011-07-29 12:58:40 -0400 (Fri, 29 Jul 2011) | 9 lines

  Merged revisions 330203 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.8

  ........
    r330203 | seanbright | 2011-07-29 12:58:08 -0400 (Fri, 29 Jul 2011) | 2 lines

    Only write to wav files that were opened to be written to.
  ........
................

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@330205 65c4cc65-6c06-0410-ace0-fbb531ad65f3

formats/format_wav.c

index f311522..17a4af0 100644 (file)
@@ -340,6 +340,10 @@ static void wav_close(struct ast_filestream *s)
        char zero = 0;
        struct wav_desc *fs = (struct wav_desc *)s->_private;
 
+       if ((s->mode & O_RDONLY) == O_RDONLY) {
+               return;
+       }
+
        if (s->filename) {
                update_header(s->f);
        }