X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmisc.cpp;h=6f908fd2730bb61cc3645449886616ac0e9a5e54;hp=b1539ce20ea5d8e9d5d606154932c7f4df89c900;hb=3804effb341b3008326a1613923177eb83d02826;hpb=4c986b050111e4fb96716a75ae2168c005b03df9 diff --git a/src/misc.cpp b/src/misc.cpp index b1539ce2..6f908fd2 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); } @@ -168,7 +175,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();