You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by pf...@apache.org on 2013/01/14 22:04:20 UTC

svn commit: r1433129 - /openoffice/trunk/main/sal/osl/unx/file.cxx

Author: pfg
Date: Mon Jan 14 21:04:19 2013
New Revision: 1433129

URL: http://svn.apache.org/viewvc?rev=1433129&view=rev
Log:
i121614 - SAL Unix file handling: used pread/pwrite on FreeBSD

Modified:
    openoffice/trunk/main/sal/osl/unx/file.cxx

Modified: openoffice/trunk/main/sal/osl/unx/file.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sal/osl/unx/file.cxx?rev=1433129&r1=1433128&r2=1433129&view=diff
==============================================================================
--- openoffice/trunk/main/sal/osl/unx/file.cxx (original)
+++ openoffice/trunk/main/sal/osl/unx/file.cxx Mon Jan 14 21:04:19 2013
@@ -348,7 +348,7 @@ oslFileError FileHandle_Impl::readAt (
     if (!(m_state & STATE_READABLE))
         return osl_File_E_BADF;
 
-#if defined(LINUX) || defined(SOLARIS)
+#if defined(LINUX) || defined(SOLARIS) || defined(FREEBSD) || defined(MACOSX)
 
     ssize_t nBytes = ::pread (m_fd, pBuffer, nBytesRequested, nOffset);
     if ((-1 == nBytes) && (EOVERFLOW == errno))
@@ -362,7 +362,7 @@ oslFileError FileHandle_Impl::readAt (
     if (-1 == nBytes)
         return oslTranslateFileError (OSL_FET_ERROR, errno);
 
-#else /* !(LINUX || SOLARIS) */
+#else /* no pread(2) ! */
 
     if (nOffset != m_offset)
 	{
@@ -376,7 +376,7 @@ oslFileError FileHandle_Impl::readAt (
         return oslTranslateFileError (OSL_FET_ERROR, errno);
 	m_offset += nBytes;
 
-#endif /* !(LINUX || SOLARIS) */
+#endif /* no pread(2) ! */
 
     OSL_FILE_TRACE("FileHandle_Impl::readAt(%d, %lld, %ld)", m_fd, nOffset, nBytes);
     *pBytesRead = nBytes;
@@ -397,13 +397,13 @@ oslFileError FileHandle_Impl::writeAt (
     if (!(m_state & STATE_WRITEABLE))
         return osl_File_E_BADF;
 
-#if defined(LINUX) || defined(SOLARIS)
+#if defined(LINUX) || defined(SOLARIS) || defined(FREEBSD) || defined(MACOSX)
 
     ssize_t nBytes = ::pwrite (m_fd, pBuffer, nBytesToWrite, nOffset);
     if (-1 == nBytes)
         return oslTranslateFileError (OSL_FET_ERROR, errno);
 
-#else /* !(LINUX || SOLARIS) */
+#else /* no pwrite(2) ! */
 
     if (nOffset != m_offset)
 	{
@@ -417,7 +417,7 @@ oslFileError FileHandle_Impl::writeAt (
         return oslTranslateFileError (OSL_FET_ERROR, errno);
 	m_offset += nBytes;
 
-#endif /* !(LINUX || SOLARIS) */
+#endif /* no pwrite(2) ! */
 
     OSL_FILE_TRACE("FileHandle_Impl::writeAt(%d, %lld, %ld)", m_fd, nOffset, nBytes);
     m_size = std::max (m_size, sal::static_int_cast< sal_uInt64 >(nOffset + nBytes));