Attention Bug Marshal.... Was Re: [Asterisk-Dev] behaviour of ast_writefile (file.c) and wav_rewrite (format_wav.c)

Steven Critchfield critch at basesys.com
Wed Feb 2 15:45:55 MST 2005


Better patch available. Used bitwise math for removing the flag instead
of integer math. Bug was reported and patch submitted to Mantis. Bug
number 0003498.
http://bugs.digium.com/bug_view_page.php?bug_id=0003498

Please review the patch and commit please.

On Wed, 2005-02-02 at 13:08 -0600, Steven Critchfield wrote:
> pbx:/usr/src/asterisk# cvs diff -u file.c
> Index: file.c
> ===================================================================
> RCS file: /usr/cvsroot/asterisk/file.c,v
> retrieving revision 1.39
> diff -u -r1.39 file.c
> --- file.c      6 Apr 2004 22:17:31 -0000       1.39
> +++ file.c      2 Feb 2005 18:32:04 -0000
> @@ -812,8 +812,12 @@
>                 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;
Now reads
		flags &= ~O_APPEND;


> +       }else{
>                 myflags = O_TRUNC;
> +       }
>  
>         myflags |= O_WRONLY | O_CREAT;
> 
>  
-- 
Steven Critchfield <critch at basesys.com>




More information about the asterisk-dev mailing list