X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmisc.cpp;h=2a8832d573f91a0a6a3721117e3f1e7b87d03672;hp=43a73b2870ddce46e12bf32ab9b2f5dfcc5db4cf;hb=7196f4c2370d0c7acd8ec3ed8de7ecb7f0682123;hpb=59f7ecdea273442f1c06569f05632cac0000f93f diff --git a/src/misc.cpp b/src/misc.cpp index 43a73b28..2a8832d5 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -102,6 +102,13 @@ public: 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); } @@ -169,7 +176,7 @@ void dbg_print() { std::ostream& operator<<(std::ostream& os, SyncCout sc) { - static Mutex m; + static std::mutex m; if (sc == IO_LOCK) m.lock();