Merge pull request #749 from cxd4/inverted-condition
logging class: fixed likely regression with create/open conditions
This commit is contained in:
commit
c4b11a68f5
|
@ -79,14 +79,10 @@ bool CFile::Open(const char * lpszFileName, uint32_t nOpenFlags)
|
||||||
sa.bInheritHandle = (nOpenFlags & modeNoInherit) == 0;
|
sa.bInheritHandle = (nOpenFlags & modeNoInherit) == 0;
|
||||||
|
|
||||||
// map creation flags
|
// map creation flags
|
||||||
ULONG dwCreateFlag = 0;
|
ULONG dwCreateFlag = OPEN_EXISTING;
|
||||||
if (nOpenFlags & modeCreate)
|
if (nOpenFlags & modeCreate)
|
||||||
{
|
{
|
||||||
dwCreateFlag = nOpenFlags & modeNoTruncate == 0 ? OPEN_ALWAYS : CREATE_ALWAYS;
|
dwCreateFlag = ((nOpenFlags & modeNoTruncate) != 0) ? OPEN_ALWAYS : CREATE_ALWAYS;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dwCreateFlag = OPEN_EXISTING;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// attempt file creation
|
// attempt file creation
|
||||||
|
|
Loading…
Reference in New Issue