Fix gcc warning about double close. forkedChildProcess() calls 
closeDescriptors(), which always closes STDERR_FILENO + 1 and STDERR_FILENO + 
2. However, if it fails at some point after that, then forkedChildProcess() 
will attempt to close these same two files again. Fixed by making 
forkedChildProcess() no longer attempt to close these two files.

I first verified the warning by configuring with 
--with-extra-cflags=-fanalyzer, and then verified the fix by doing the same.

Tested by running jdi nsk test. I'll add some more CI testing.

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

Commit messages:
 - fix gcc warning about double close()

Changes: https://git.openjdk.org/jdk/pull/26487/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26487&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8361873
  Stats: 9 lines in 1 file changed: 5 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/26487.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26487/head:pull/26487

PR: https://git.openjdk.org/jdk/pull/26487

Reply via email to