mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-22 22:05:38 +00:00
GameList: Always open icon cache with r+b on Linux
Fixes flock() error on startup.
This commit is contained in:
parent
2cfa535784
commit
5da6c926d9
|
@ -1655,9 +1655,15 @@ static constexpr const char MEMCARD_TIMESTAMP_CACHE_SIGNATURE[] = {'M', 'C', 'D'
|
||||||
FileSystem::ManagedCFilePtr GameList::OpenMemoryCardTimestampCache(bool for_write)
|
FileSystem::ManagedCFilePtr GameList::OpenMemoryCardTimestampCache(bool for_write)
|
||||||
{
|
{
|
||||||
const std::string filename = Path::Combine(EmuFolders::Cache, "memcard_icons.cache");
|
const std::string filename = Path::Combine(EmuFolders::Cache, "memcard_icons.cache");
|
||||||
const char* mode = for_write ? "r+b" : "rb";
|
|
||||||
const FileSystem::FileShareMode share_mode =
|
const FileSystem::FileShareMode share_mode =
|
||||||
for_write ? FileSystem::FileShareMode::DenyReadWrite : FileSystem::FileShareMode::DenyWrite;
|
for_write ? FileSystem::FileShareMode::DenyReadWrite : FileSystem::FileShareMode::DenyWrite;
|
||||||
|
#ifdef _WIN32
|
||||||
|
const char* mode = for_write ? "r+b" : "rb";
|
||||||
|
#else
|
||||||
|
// Always open read/write on Linux, since we need it for flock().
|
||||||
|
const char* mode = "r+b";
|
||||||
|
#endif
|
||||||
|
|
||||||
FileSystem::ManagedCFilePtr fp = FileSystem::OpenManagedSharedCFile(filename.c_str(), mode, share_mode, nullptr);
|
FileSystem::ManagedCFilePtr fp = FileSystem::OpenManagedSharedCFile(filename.c_str(), mode, share_mode, nullptr);
|
||||||
if (fp)
|
if (fp)
|
||||||
return fp;
|
return fp;
|
||||||
|
|
Loading…
Reference in a new issue