Integrated: JDK-8313691: use close after failing os::fdopen in vmError and ciEnv

Matthias Baesken mbaesken at openjdk.org
Wed Aug 9 06:57:44 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.

This pull request has now been integrated.

Changeset: 96304f37
Author:    Matthias Baesken <mbaesken at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/96304f37f8344b0c0e271ff9cda84961519d5109
Stats:     3 lines in 2 files changed: 3 ins; 0 del; 0 mod

8313691: use close after failing os::fdopen in vmError and ciEnv

Reviewed-by: dholmes, thartmann

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

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


More information about the hotspot-dev mailing list