On Wed, 17 May 2023 16:05:58 GMT, Volker Simonis <simo...@openjdk.org> wrote:

>> 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.

I usually init fds with -1. It's mostly a protection against bitrot and general 
cleanliness.

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

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

Reply via email to