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:
parent
c89ad38ef1
commit
a32f979814
@ -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))
|
if (!m_file.open(buf_name, fs::read + fs::rewrite + fs::lock))
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
auto prev_error = fs::g_tls_error;
|
||||||
|
|
||||||
if (fs::exists(s_filelock))
|
if (fs::exists(s_filelock))
|
||||||
{
|
{
|
||||||
// A restart is happening, wait for the file to be accessible
|
// 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++;
|
tries++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fs::g_tls_error = prev_error;
|
||||||
|
}
|
||||||
|
|
||||||
if (!m_file)
|
if (!m_file)
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user