From 125ee98508d005371fc98340a5667da2aef8f194 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 9f30eb72..3fe0c9a1 100644 --- a/prism/src/prism/PrismCL.java +++ b/prism/src/prism/PrismCL.java @@ -1023,7 +1023,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(); } @@ -1772,6 +1775,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");