From 0f2fce71680355412896b2cb2d96cc85f69324e7 Mon Sep 17 00:00:00 2001 From: Matthias Baesken Date: Thu, 3 Aug 2023 12:02:52 +0000 Subject: [PATCH] 8313632: ciEnv::dump_replay_data use fclose Reviewed-by: thartmann, lucy --- src/hotspot/share/ci/ciEnv.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hotspot/share/ci/ciEnv.cpp b/src/hotspot/share/ci/ciEnv.cpp index 9863a124ed1..da12eaa1e5c 100644 --- a/src/hotspot/share/ci/ciEnv.cpp +++ b/src/hotspot/share/ci/ciEnv.cpp @@ -1708,8 +1708,10 @@ void ciEnv::dump_replay_data(int compile_id) { fileStream replay_data_stream(replay_data_file, /*need_close=*/true); dump_replay_data(&replay_data_stream); tty->print_cr("# Compiler replay data is saved as: %s", buffer); + fclose(replay_data_file); } else { tty->print_cr("# Can't open file to dump replay data."); + close(fd); } } } @@ -1732,8 +1734,10 @@ void ciEnv::dump_inline_data(int compile_id) { replay_data_stream.flush(); tty->print("# Compiler inline data is saved as: "); tty->print_cr("%s", buffer); + fclose(inline_data_file); } else { tty->print_cr("# Can't open file to dump inline data."); + close(fd); } } }