diff options
Diffstat (limited to 'extensions/source/logging/filehandler.cxx')
-rw-r--r-- | extensions/source/logging/filehandler.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/extensions/source/logging/filehandler.cxx b/extensions/source/logging/filehandler.cxx index 97d6d7524290..e04ea8faf0be 100644 --- a/extensions/source/logging/filehandler.cxx +++ b/extensions/source/logging/filehandler.cxx @@ -328,7 +328,16 @@ namespace logging void SAL_CALL FileHandler::flush( ) throw (RuntimeException) { MethodGuard aGuard( *this ); - // nothing to do, our ::osl::File implementation is not buffered + if(!m_pFile.get()) + { + OSL_PRECOND(false, "FileHandler::flush: no file!"); + return; + } + #if OSL_DEBUG_LEVEL > 0 + ::osl::FileBase::RC res = + #endif + m_pFile->sync(); + OSL_ENSURE(res == ::osl::FileBase::E_None, "FileHandler::flush: Could not sync logfile to filesystem."); } //-------------------------------------------------------------------- |