mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-10-09 10:39:29 +00:00
Fix a race-condition when two games have been started simultaneously and attempt to create the same replay directory, refs #3255.
Instead of triggering a debug-breakpoint, print a warning to stdout and succeed in the N'th retry when having started N processes simultaneously. Previously the problem had been addressed by using the processID in the directory name. This was SVN commit r17776.
This commit is contained in:
@@ -298,7 +298,6 @@ void CSimulation2Impl::ReportSerializationFailure(
|
||||
{
|
||||
const OsPath path = getDateIndexSubdirectory(psLogDir() / "serializationtest");
|
||||
debug_printf("Writing serializationtest-data to %s\n", path.string8().c_str());
|
||||
CreateDirectories(path, 0700);
|
||||
|
||||
// Clean up obsolete files from previous runs
|
||||
wunlink(path / "hash.before.a");
|
||||
@@ -554,7 +553,6 @@ void CSimulation2Impl::DumpState()
|
||||
std::stringstream name;\
|
||||
name << std::setw(5) << std::setfill('0') << m_TurnNumber << ".txt";
|
||||
const OsPath path = m_OOSLogPath / name.str();
|
||||
CreateDirectories(path.Parent(), 0700);
|
||||
std::ofstream file (OsString(path).c_str(), std::ofstream::out | std::ofstream::trunc);
|
||||
|
||||
file << "State hash: " << std::hex;
|
||||
|
||||
Reference in New Issue
Block a user