diff options
author | Brad King <brad.king@kitware.com> | 2015-03-25 13:01:18 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-03-25 13:01:18 (GMT) |
commit | 166e29e453e6a48e191b02835b08cf5bd3d0f988 (patch) | |
tree | ed5854583c17b708a72ae2b3272a2a9cfa7f07ac /Source | |
parent | 26c43005847394ab110ebbdb29f1a1f37eaa7b7a (diff) | |
parent | 1f289095f908fddd64152c5686bec25eecbc66d6 (diff) | |
download | CMake-166e29e453e6a48e191b02835b08cf5bd3d0f988.zip CMake-166e29e453e6a48e191b02835b08cf5bd3d0f988.tar.gz CMake-166e29e453e6a48e191b02835b08cf5bd3d0f988.tar.bz2 |
Merge topic 'file-LOCK-close'
1f289095 file(LOCK): Close file descriptor/handle when releasing a lock
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFileLockUnix.cxx | 4 | ||||
-rw-r--r-- | Source/cmFileLockWin32.cxx | 3 |
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(); |