RFR: JDK-8313691: use close after failing os::fdopen in vmError

David Holmes dholmes at openjdk.org
Fri Aug 4 05:57:29 UTC 2023


On Thu, 3 Aug 2023 14:02:22 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

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

Functional fix is fine but the comment change is not needed IMO and becomes inconsistent with similar uses in ciEnv.cpp

Thanks

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

Marked as reviewed by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15139#pullrequestreview-1562217671


More information about the hotspot-dev mailing list