diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-07-02 22:18:03 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-07-02 22:18:03 +0200 |
commit | 6cfce7dd5f5e6b8af2ba50fcf8a287db0a4a1d17 (patch) | |
tree | 28c860a21b1db9b8a3829466ef245b8765cc7e34 /desktop | |
parent | 1f5523197de2a713118a2309583af8d81358f1f5 (diff) |
Handle osl::File::setPos failure
Change-Id: Icf21c14f44250e1680dd7521dbb0e1260614a573
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/deployment/dp_persmap.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/desktop/source/deployment/dp_persmap.cxx b/desktop/source/deployment/dp_persmap.cxx index d52aa38d89b8..d193193b93b3 100644 --- a/desktop/source/deployment/dp_persmap.cxx +++ b/desktop/source/deployment/dp_persmap.cxx @@ -157,9 +157,13 @@ void PersistentMap::open() void PersistentMap::readAll() { // prepare for re-reading the map-file - const osl::FileBase::RC nRes = m_MapFile.setPos( osl_Pos_Absolut, 0); - (void)nRes; m_entries.clear(); + const osl::FileBase::RC nRes = m_MapFile.setPos( osl_Pos_Absolut, 0); + if (nRes != osl::FileBase::E_None) + { + SAL_WARN("desktop.deployment", "setPos failed with " << +nRes); + return; + } // read header and check magic char aHeaderBytes[ sizeof(PmapMagic)]; @@ -218,7 +222,11 @@ void PersistentMap::flush() // write header magic const osl::FileBase::RC nRes = m_MapFile.setPos( osl_Pos_Absolut, 0); - (void)nRes; + if (nRes != osl::FileBase::E_None) + { + SAL_WARN("desktop.deployment", "setPos failed with " << +nRes); + return; + } sal_uInt64 nBytesWritten = 0; m_MapFile.write( PmapMagic, sizeof(PmapMagic), nBytesWritten); |