aboutsummaryrefslogtreecommitdiff
path: root/src/fs.cpp
diff options
context:
space:
mode:
authorChun Kuan Lee <ken2812221@gmail.com>2018-10-08 00:24:20 +0800
committerChun Kuan Lee <ken2812221@gmail.com>2018-10-19 02:29:25 +0800
commit369244f654c9e36b803e841eb30fd0aa2960087a (patch)
treecc74ae7e3a5c7ae7f463bd409f0492491e25e33b /src/fs.cpp
parentfe23553edd84b0247e05ec3de023944c558afd54 (diff)
downloadbitcoin-369244f654c9e36b803e841eb30fd0aa2960087a.tar.xz
utils: Fix broken Windows filelock
Diffstat (limited to 'src/fs.cpp')
-rw-r--r--src/fs.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fs.cpp b/src/fs.cpp
index a146107c4c..3c8f4c0247 100644
--- a/src/fs.cpp
+++ b/src/fs.cpp
@@ -3,6 +3,7 @@
#ifndef WIN32
#include <fcntl.h>
#else
+#define NOMINMAX
#include <codecvt>
#include <windows.h>
#endif
@@ -89,7 +90,7 @@ bool FileLock::TryLock()
return false;
}
_OVERLAPPED overlapped = {0};
- if (!LockFileEx(hFile, LOCKFILE_EXCLUSIVE_LOCK | LOCKFILE_FAIL_IMMEDIATELY, 0, 0, 0, &overlapped)) {
+ if (!LockFileEx(hFile, LOCKFILE_EXCLUSIVE_LOCK | LOCKFILE_FAIL_IMMEDIATELY, 0, std::numeric_limits<DWORD>::max(), std::numeric_limits<DWORD>::max(), &overlapped)) {
reason = GetErrorReason();
return false;
}