Bug in stream.c when TRACE_JB is set to 1 on Linux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 18, 2011 at 2:33 PM, Dan <dan at keystream.se> wrote:
> Hi,
> when setting TRACE_JB to 1 in stream.c a trace file is created with the
> following call:
> pj_file_open(pool, trace_name, PJ_O_RDWR, &stream->trace_jb_fd);
>
> This will in turn cause a call to fopen with the mode set to "r+b" which
> won't create the file if it doesn't exist (at least on Linux, the
> situation might be different on Windows). If we instead call
> pj_file_open() with the parameter PJ_O_WRONLY the mode in the call to
> fopen will be "wb" which will indeed create the file if it doesn't
> exist.
> I'm attaching a patch file which will replace PJ_O_RDWR with
> PJ_O_WRONLY.
>

I see, so that's the problem! Did it also return PJ_SUCCESS when it
fails to create the file? That sounds like another bug.

Anyway I just committed your patch in r3831.

Thanks!
 Benny



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux