port from 1.4.4 (rev. 1925 fixed SF# 3483174)

This commit is contained in:
Aleksandar Fabijanic
2012-08-22 03:25:25 +00:00
parent d9cf671330
commit 801b2485f4
13 changed files with 94 additions and 21 deletions

View File

@@ -61,7 +61,7 @@ LogFileImpl::~LogFileImpl()
}
void LogFileImpl::writeImpl(const std::string& text)
void LogFileImpl::writeImpl(const std::string& text, bool flush)
{
if (INVALID_HANDLE_VALUE == _hFile) createFile();
@@ -70,8 +70,11 @@ void LogFileImpl::writeImpl(const std::string& text)
if (!res) throw WriteFileException(_path);
res = WriteFile(_hFile, "\r\n", 2, &bytesWritten, NULL);
if (!res) throw WriteFileException(_path);
res = FlushFileBuffers(_hFile);
if (!res) throw WriteFileException(_path);
if (flush)
{
res = FlushFileBuffers(_hFile);
if (!res) throw WriteFileException(_path);
}
}