Merge topic 'file-LOCK-close'

1f289095 file(LOCK): Close file descriptor/handle when releasing a lock
This commit is contained in:
Brad King 2015-03-25 09:01:18 -04:00 committed by CMake Topic Stage
commit 166e29e453
2 changed files with 7 additions and 0 deletions

View File

@ -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();

View File

@ -38,6 +38,9 @@ cmFileLockResult cmFileLock::Release()
this->Filename = "";
CloseHandle(this->File);
this->File = INVALID_HANDLE_VALUE;
if (unlockResult)
{
return cmFileLockResult::MakeOk();