summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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();