diff options
| author | Chun Kuan Lee <[email protected]> | 2018-10-08 00:24:20 +0800 |
|---|---|---|
| committer | Chun Kuan Lee <[email protected]> | 2018-10-19 02:29:25 +0800 |
| commit | 369244f654c9e36b803e841eb30fd0aa2960087a (patch) | |
| tree | cc74ae7e3a5c7ae7f463bd409f0492491e25e33b /src | |
| parent | Merge #14374: qt: Add "Blocksdir" to Debug window (diff) | |
| download | discoin-369244f654c9e36b803e841eb30fd0aa2960087a.tar.xz discoin-369244f654c9e36b803e841eb30fd0aa2960087a.zip | |
utils: Fix broken Windows filelock
Diffstat (limited to 'src')
| -rw-r--r-- | src/fs.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fs.cpp b/src/fs.cpp index a146107c4..3c8f4c024 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; } |