mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 03:25:16 +00: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))
|
||||
{
|
||||
#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
|
||||
|
|
Loading…
Add table
Reference in a new issue