diff options
author | Chris Wilson <chris+github@qwirx.com> | 2015-12-13 23:46:22 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2015-12-14 00:06:03 +0000 |
commit | e9ea5f21a90cca3623115a3c901d033b81f97eb6 (patch) | |
tree | ff69f071656d2656d91b247d01195b75b000b945 /lib/common | |
parent | 004c1d3b39f045f0f3935f6ca7cb9cb1960573ea (diff) |
Fix Windows file locking to work with MSVC
Diffstat (limited to 'lib/common')
-rw-r--r-- | lib/common/NamedLock.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/common/NamedLock.cpp b/lib/common/NamedLock.cpp index 8cacf065..e440408e 100644 --- a/lib/common/NamedLock.cpp +++ b/lib/common/NamedLock.cpp @@ -82,6 +82,9 @@ bool NamedLock::TryAndGetLock(const std::string& rFilename, int mode) #if HAVE_DECL_O_EXLOCK flags |= O_NONBLOCK | O_EXLOCK; BOX_TRACE("Trying to create lockfile " << rFilename << " using O_EXLOCK"); +#elif defined BOX_OPEN_LOCK + flags |= BOX_OPEN_LOCK; + BOX_TRACE("Trying to create lockfile " << rFilename << " using BOX_OPEN_LOCK"); #elif !HAVE_DECL_F_SETLK && !defined HAVE_FLOCK // We have no other way to get a lock, so all we can do is fail if // the file already exists, and take the risk of stale locks. |