summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-03-25 13:01:32 (GMT)
committerBrad King <brad.king@kitware.com>2015-03-26 13:02:48 (GMT)
commitdc311f5f9dc38b0368e5c0dd11854bb66d6f2093 (patch)
tree0a5011fec3d2e25e49d693771cac583880e710ea
parent732d8a467ab8a295b1bbf580f865980f8a1a9b29 (diff)
parent1f289095f908fddd64152c5686bec25eecbc66d6 (diff)
downloadCMake-dc311f5f9dc38b0368e5c0dd11854bb66d6f2093.zip
CMake-dc311f5f9dc38b0368e5c0dd11854bb66d6f2093.tar.gz
CMake-dc311f5f9dc38b0368e5c0dd11854bb66d6f2093.tar.bz2
Merge branch 'file-LOCK-close' into release
-rw-r--r--Source/cmFileLockUnix.cxx4
-rw-r--r--Source/cmFileLockWin32.cxx3
2 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmFileLockUnix.cxx b/Source/cmFileLockUnix.cxx
index fc18a64..36a2d72 100644
--- a/Source/cmFileLockUnix.cxx
+++ b/Source/cmFileLockUnix.cxx
@@ -15,6 +15,7 @@
#include <errno.h> // errno
#include <stdio.h> // SEEK_SET
#include <fcntl.h>
+#include <unistd.h>
#include "cmSystemTools.h"
cmFileLock::cmFileLock(): File(-1)
@@ -31,6 +32,9 @@ cmFileLockResult cmFileLock::Release()
this->Filename = "";
+ ::close(this->File);
+ this->File = -1;
+
if (lockResult == 0)
{
return cmFileLockResult::MakeOk();
diff --git a/Source/cmFileLockWin32.cxx b/Source/cmFileLockWin32.cxx
index 4691689..dc65948 100644
--- a/Source/cmFileLockWin32.cxx
+++ b/Source/cmFileLockWin32.cxx
@@ -38,6 +38,9 @@ cmFileLockResult cmFileLock::Release()
this->Filename = "";
+ CloseHandle(this->File);
+ this->File = INVALID_HANDLE_VALUE;
+
if (unlockResult)
{
return cmFileLockResult::MakeOk();