From c557b36cc8a7388d428cb618601f10e5382a4c40 Mon Sep 17 00:00:00 2001 From: Joost VandeVondele Date: Mon, 21 Oct 2019 08:05:14 +0200 Subject: [PATCH] Check Log File opening like we do with the fenFile, check Log file on creation. closes #2365 No functional change. --- src/misc.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/misc.cpp b/src/misc.cpp index 17644eed895..6f908fd2730 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -102,6 +102,13 @@ class Logger { if (!fname.empty() && !l.file.is_open()) { l.file.open(fname, ifstream::out); + + if (!l.file.is_open()) + { + cerr << "Unable to open debug log file " << fname << endl; + exit(EXIT_FAILURE); + } + cin.rdbuf(&l.in); cout.rdbuf(&l.out); }