mirror of
https://github.com/Tencent/MMKV.git
synced 2026-10-17 04:30:56 +08:00
dont check process mode on open() failure
This commit is contained in:
@@ -208,6 +208,11 @@ void MMKV::checkReSetCryptKey(int fd, int metaFD, string *cryptKey) {
|
||||
# endif // MMKV_DISABLE_CRYPT
|
||||
|
||||
bool MMKV::checkProcessMode() {
|
||||
// avoid exception on open() error
|
||||
if (!m_file->isFileValid()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!m_fileModeLock) {
|
||||
// force use fcntl(), otherwise will conflict with MemoryFile::reloadFromFile()
|
||||
m_fileModeLock = new FileLock(m_file->getFd(), true);
|
||||
|
||||
Reference in New Issue
Block a user