From f1a2c6019e6b2da98fef8496d7f21b79e89648aa Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 10 Feb 2020 06:18:10 +0100 Subject: [PATCH] 8238366: CTW runner closes standard output on exit Reviewed-by: adinn, iignatyev --- .../ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java index 24978b04679..7052fefe3b8 100644 --- a/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java +++ b/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java @@ -99,9 +99,11 @@ public class CompileTheWorld { } catch (Throwable t){ t.printStackTrace(ERR); } finally { - try { - OUT.close(); - } catch (Throwable ignore) { + if (OUT != System.out) { + try { + OUT.close(); + } catch (Throwable ignore) { + } } // might have started new threads System.exit(passed ? 0 : 1);