diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-07-18 10:04:19 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-07-18 13:56:44 +0200 |
commit | 644af27d6dc02ce6c238aa76e1ff8182953946e0 (patch) | |
tree | affd9724d45d8d0da14161f9144ce47db1cb2798 /extensions | |
parent | 33b962536a3e2d32e0066c0ad8423809037d38dd (diff) |
cid#703953 Unchecked return value
Change-Id: Id4164e0adc71e57e4c732016306bb53ae7ac4ad7
Reviewed-on: https://gerrit.libreoffice.org/75837
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/logging/filehandler.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/extensions/source/logging/filehandler.cxx b/extensions/source/logging/filehandler.cxx index 7b6331d477da..3aa0927ce54d 100644 --- a/extensions/source/logging/filehandler.cxx +++ b/extensions/source/logging/filehandler.cxx @@ -174,10 +174,12 @@ namespace logging m_pFile.reset( new ::osl::File( m_sFileURL ) ); // check whether the log file already exists ::osl::DirectoryItem aFileItem; - ::osl::DirectoryItem::get( m_sFileURL, aFileItem ); - ::osl::FileStatus aStatus( osl_FileStatus_Mask_Validate ); - if ( ::osl::FileBase::E_None == aFileItem.getFileStatus( aStatus ) ) - ::osl::File::remove( m_sFileURL ); + if (osl::FileBase::E_None == ::osl::DirectoryItem::get(m_sFileURL, aFileItem)) + { + ::osl::FileStatus aStatus(osl_FileStatus_Mask_Validate); + if (::osl::FileBase::E_None == aFileItem.getFileStatus(aStatus)) + ::osl::File::remove(m_sFileURL); + } ::osl::FileBase::RC res = m_pFile->open( osl_File_OpenFlag_Write | osl_File_OpenFlag_Create ); m_eFileValidity = res == ::osl::FileBase::E_None |