1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00

Conserve error value when trying to open log file

This commit is contained in:
RipleyTom 2019-10-24 21:13:51 +02:00 committed by Ivan
parent c89ad38ef1
commit a32f979814

View File

@ -332,6 +332,8 @@ logs::file_writer::file_writer(const std::string& name)
if (!m_file.open(buf_name, fs::read + fs::rewrite + fs::lock))
{
#ifdef _WIN32
auto prev_error = fs::g_tls_error;
if (fs::exists(s_filelock))
{
// A restart is happening, wait for the file to be accessible
@ -342,6 +344,10 @@ logs::file_writer::file_writer(const std::string& name)
tries++;
}
}
else
{
fs::g_tls_error = prev_error;
}
if (!m_file)
#endif