Patch: PR libgcj/23758, Fix theoretical race PosixProcess.

David Daney ddaney@avtrex.com
Mon Apr 9 17:46:00 GMT 2007


Tom Tromey wrote:
>>>>>> "David" == David Daney <ddaney@avtrex.com> writes:
>>>>>>             
>
> David> This patch moves the mallocs out of the danger zone in
> David> natPosixProcess.cc
>
> David> OK to commit?
>
> Two nits -- fix these and it is ok.
>
> David> +          // explicitly.  We need three extra slots.  Potentailly PATH
>
> Typo, should be "potentially".
>
> David> +              if (0 == strncmp (env[i], "PATH=", sizeof("PATH=")))
> David> +                need_path = false;
> David> +              if (0 == strncmp (env[i], "LD_LIBRARY_PATH=",
> David> +                                sizeof("LD_LIBRARY_PATH=")))
> David> +                need_ld_library_path = false;
>
> Use "! strncmp" instead.  That's libgcj convention.
>   
This is the version I committed:

2007-04-09  David Daney  <ddaney@avtrex.com>

    PR libgcj/23758
    * java/lang/natPosixProcess.cc (nativeSpawn): Move building of
    environment before the fork.
    * testsuite/libjava.lang/Process_7.java: New test.
    * testsuite/libjava.lang/Process_7.out: Its expected results.
    * testsuite/libjava.lang/Process_7.jar: Generated file.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: process.diff.txt
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20070409/1ca11ac4/attachment.txt>


More information about the Java-patches mailing list