From 652271df38aaf4f613dedc546904e8e65b57608b Mon Sep 17 00:00:00 2001 From: Joachim Klein Date: Fri, 12 Oct 2018 14:24:30 +0200 Subject: [PATCH] imported patch PrismCL-protect-mainlog.patch --- prism/src/prism/PrismCL.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/prism/src/prism/PrismCL.java b/prism/src/prism/PrismCL.java index 55037467..23d47aa8 100644 --- a/prism/src/prism/PrismCL.java +++ b/prism/src/prism/PrismCL.java @@ -1041,7 +1041,10 @@ public class PrismCL implements PrismModelListener mainLog.println(" during computation."); } mainLog.println(); - // Close logs (in case they are files) + + // Close log (in case they are files) + // Remove protection against closing, as here we really want to close it + mainLog.setIgnoreClose(false); mainLog.close(); } @@ -1817,6 +1820,9 @@ public class PrismCL implements PrismModelListener errorAndExit("Couldn't open log file \"" + mainLogFilename + "\""); } mainLog = log; + // we set the flag that close() should be ignored for this log, + // similar to how stdout is treated automatically + mainLog.setIgnoreClose(true); prism.setMainLog(mainLog); } else { errorAndExit("No file specified for -" + sw + " switch");