diff --git a/src/common/file_system.cpp b/src/common/file_system.cpp index 7f4dda7e5..be3065487 100644 --- a/src/common/file_system.cpp +++ b/src/common/file_system.cpp @@ -2818,7 +2818,7 @@ static bool SetLock(int fd, bool lock, bool block, Error* error) bool res; for (;;) { - res = (lockf(fd, lock ? (block ? F_TLOCK : F_LOCK) : F_ULOCK, 0) == 0); + res = (lockf(fd, lock ? (block ? F_LOCK : F_TLOCK) : F_ULOCK, 0) == 0); if (!res && errno == EINTR) continue; else diff --git a/src/util/opengl_pipeline.cpp b/src/util/opengl_pipeline.cpp index 35762c5ea..0d9067e2f 100644 --- a/src/util/opengl_pipeline.cpp +++ b/src/util/opengl_pipeline.cpp @@ -767,7 +767,7 @@ bool OpenGLDevice::OpenPipelineCache(const std::string& path, Error* error) #ifdef HAS_POSIX_FILE_LOCK // Unix doesn't prevent concurrent write access, need to explicitly lock it. - FileSystem::POSIXLock fp_lock(fp.get(), true, error); + FileSystem::POSIXLock fp_lock(fp.get(), false, error); if (!fp_lock.IsLocked()) { Error::AddPrefix(error, "Failed to lock cache file: "); @@ -865,7 +865,7 @@ bool OpenGLDevice::CreatePipelineCache(const std::string& path, Error* error) if (!m_pipeline_disk_cache_file || !FileSystem::FSeek64(m_pipeline_disk_cache_file, 0, SEEK_SET, error)) return false; - m_pipeline_disk_cache_file_lock = FileSystem::POSIXLock(m_pipeline_disk_cache_file, true, error); + m_pipeline_disk_cache_file_lock = FileSystem::POSIXLock(m_pipeline_disk_cache_file, false, error); if (!m_pipeline_disk_cache_file_lock.IsLocked()) { Error::AddPrefix(error, "Failed to lock cache file: ");