summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2018-10-11 18:19:25 +0300
committerTor Lillqvist <tml@collabora.com>2018-10-11 19:57:40 +0300
commitfb4c929328027b1a804f214c4d189c9b59e0af51 (patch)
tree3875f0f1e68896d898f39d2060fdf57358439e40 /sal
parent80d1ac7d55c22de20edeec30f8f56e09f8455f8d (diff)
Do the SAL_INFO() for the fsync() call only when we know the result
Change-Id: I4bea64f959a6d6f3010809261804748b4fcd7718
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/file.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 910345d74f28..6ef6196f8c37 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -1061,15 +1061,19 @@ oslFileError SAL_CALL osl_syncFile(oslFileHandle Handle)
FileHandle_Impl::Guard lock(&(pImpl->m_mutex));
- SAL_INFO("sal.file", "osl_syncFile(" << pImpl->m_fd << ")");
-
oslFileError result = pImpl->syncFile();
if (result != osl_File_E_None)
return result;
if (fsync(pImpl->m_fd) == -1)
+ {
+ int e = errno;
+ SAL_INFO("sal.file", "fsync(" << pImpl->m_fd << "): errno " << e << ": " << strerror(e));
return oslTranslateFileError(errno);
+ }
+ else
+ SAL_INFO("sal.file", "fsync(" << pImpl->m_fd << "): OK");
return osl_File_E_None;
}