RFR: JDK-8313691: use close after failing os::fdopen in vmError and ciEnv [v2]

Matthias Baesken mbaesken at openjdk.org
Fri Aug 4 07:02:02 UTC 2023


> In vmError.cpp we use os::fdopen and in case this is successful pass the returned file pointer to a fileStream constructor.
> The fileStream object calls fclose on our file pointer  in destruction (and this closes also the underlying file descriptor fd).
> 
> However in case of failing os::fdopen we do not create (and later destruct)  a fileStream object so direct call to close might be needed. I also adjusted a comment to make it  even clearer that the fileStream object fcloses the file pointer on the destructor.

Matthias Baesken has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:

 - Adjust ciEnv.cpp and comment
 - Merge remote-tracking branch 'origin/master' into JDK-8313691
 - JDK-8313691

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/15139/files
  - new: https://git.openjdk.org/jdk/pull/15139/files/e5fb6d69..6b870bce

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=15139&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15139&range=00-01

  Stats: 127 lines in 14 files changed: 111 ins; 12 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/15139.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15139/head:pull/15139

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


More information about the hotspot-dev mailing list