[*] Harden remove/relink

This commit is contained in:
Reece Wilson 2023-12-30 19:38:58 +00:00
parent ab68f07bb9
commit 63f5ad3fd5
3 changed files with 9 additions and 1 deletions

View File

@ -90,10 +90,10 @@ static void Init()
Aurora::Console::Init();
Aurora::IO::FS::InitResources();
Aurora::IO::Init();
Aurora::Grug::InitGrug();
Aurora::Console::Init2();
Aurora::HWInfo::Init();
Aurora::Telemetry::Init();
Aurora::Grug::InitGrug();
Aurora::Debug::InitDebug();
Aurora::Locale::Init();
Aurora::CmdLine::Init();

View File

@ -344,6 +344,8 @@ namespace Aurora::IO::FS
return false;
}
Aurora::RuntimeWaitForSecondaryTick();
auto translatedPath = Locale::ConvertFromUTF8(NormalizePathRet(path));
if (translatedPath.empty())
{
@ -413,6 +415,8 @@ namespace Aurora::IO::FS
CreateDirectories(pathExpandedA, true);
Aurora::RuntimeWaitForSecondaryTick();
return ::MoveFileW(pathSrcExpanded.c_str(),
pathExpanded.c_str());
}

View File

@ -361,6 +361,8 @@ namespace Aurora::IO::FS
return false;
}
Aurora::RuntimeWaitForSecondaryTick();
if (::stat(pathExpanded.c_str(), &s) == -1)
{
if (errno == ENOENT)
@ -404,6 +406,8 @@ namespace Aurora::IO::FS
return false;
}
Aurora::RuntimeWaitForSecondaryTick();
auto pathSrcExpanded = NormalizePathRet(src);
auto pathExpanded = NormalizePathRet(dest);