summaryrefslogtreecommitdiffstats
path: root/development/qt-creator-llvm/patches/160_QTCREATORBUG-15449_Fix-files-lock-on-Windows.patch
diff options
context:
space:
mode:
Diffstat (limited to 'development/qt-creator-llvm/patches/160_QTCREATORBUG-15449_Fix-files-lock-on-Windows.patch')
-rw-r--r--development/qt-creator-llvm/patches/160_QTCREATORBUG-15449_Fix-files-lock-on-Windows.patch16
1 files changed, 16 insertions, 0 deletions
diff --git a/development/qt-creator-llvm/patches/160_QTCREATORBUG-15449_Fix-files-lock-on-Windows.patch b/development/qt-creator-llvm/patches/160_QTCREATORBUG-15449_Fix-files-lock-on-Windows.patch
new file mode 100644
index 0000000000..9a8c6028fd
--- /dev/null
+++ b/development/qt-creator-llvm/patches/160_QTCREATORBUG-15449_Fix-files-lock-on-Windows.patch
@@ -0,0 +1,16 @@
+diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp
+index 85e782b2c04..95f10753d96 100644
+--- a/lib/Support/MemoryBuffer.cpp
++++ b/lib/Support/MemoryBuffer.cpp
+@@ -284,6 +284,11 @@ static bool shouldUseMmap(int FD,
+ bool RequiresNullTerminator,
+ int PageSize,
+ bool IsVolatile) {
++#ifdef _WIN32
++ // Do not use mmap on Windows in order to avoid file locking
++ return false;
++#endif
++
+ // mmap may leave the buffer without null terminator if the file size changed
+ // by the time the last page is mapped in, so avoid it if the file size is
+ // likely to change.