Merge pull request #749 from cxd4/inverted-condition

logging class:  fixed likely regression with create/open conditions
This commit is contained in:
zilmar 2015-11-12 10:43:22 +11:00
commit c4b11a68f5
1 changed files with 2 additions and 6 deletions

View File

@ -79,14 +79,10 @@ bool CFile::Open(const char * lpszFileName, uint32_t nOpenFlags)
sa.bInheritHandle = (nOpenFlags & modeNoInherit) == 0;
// map creation flags
ULONG dwCreateFlag = 0;
ULONG dwCreateFlag = OPEN_EXISTING;
if (nOpenFlags & modeCreate)
{
dwCreateFlag = nOpenFlags & modeNoTruncate == 0 ? OPEN_ALWAYS : CREATE_ALWAYS;
}
else
{
dwCreateFlag = OPEN_EXISTING;
dwCreateFlag = ((nOpenFlags & modeNoTruncate) != 0) ? OPEN_ALWAYS : CREATE_ALWAYS;
}
// attempt file creation