RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v2]

Volker Simonis simonis at openjdk.org
Wed May 17 16:08:39 UTC 2023


On Wed, 17 May 2023 13:46:29 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Volker Simonis has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Added test case
>
> src/java.base/unix/native/jspawnhelper/jspawnhelper.c line 140:
> 
>> 138:     struct stat buf;
>> 139:     /* argv[0] contains the fd number to read all the child info */
>> 140:     int r, fdinr, fdinw, fdout;
> 
> Since you are here, can you init these?

What would be the right value to initialize them to and what would it help? We use `sscanf()` right in the following line and exit if `sscanf()` is not assigning all three values. I think that should be good enough.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13956#discussion_r1196757471


More information about the core-libs-dev mailing list