mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 14:01:25 +12:00
Conserve error value when trying to open log file
This commit is contained in:
parent
c89ad38ef1
commit
a32f979814
1 changed files with 6 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue