[Libreoffice-commits] .: sal/osl

Tor Lillqvist tml at kemper.freedesktop.org
Fri Nov 18 17:11:56 PST 2011


 sal/osl/unx/file.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 5e03999e937bc76f5020fa5b040bf403a5b37723
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Sat Nov 19 03:11:42 2011 +0200

    osl_syncFile() should work also for NULL handles

diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 7a36e69..b6b4600 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -1082,12 +1082,12 @@ SAL_CALL osl_syncFile(oslFileHandle Handle)
 {
     FileHandle_Impl* pImpl = static_cast<FileHandle_Impl*>(Handle);
 
+    if ((0 == pImpl) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && (-1 == pImpl->m_fd)))
+        return osl_File_E_INVAL;
+
     if (pImpl->m_kind == FileHandle_Impl::KIND_MEM)
         return osl_File_E_None;
 
-    if ((0 == pImpl) || (-1 == pImpl->m_fd))
-        return osl_File_E_INVAL;
-
     FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
 
     OSL_TRACE("osl_syncFile(%d)", pImpl->m_fd);


More information about the Libreoffice-commits mailing list