[ooo-build-commit] Branch 'ooo/OOO320' - sal/osl

Jan Holesovsky kendy at kemper.freedesktop.org
Fri Jan 8 20:46:50 PST 2010


 sal/osl/unx/file_misc.cxx |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 22ac0807d446e3d9bf636d06f97874a1b25f551d
Author: Oliver Bolte <obo at openoffice.org>
Date:   Fri Jan 8 08:08:56 2010 +0000

    CWS-TOOLING: integrate CWS fwk134
    2010-01-05 11:09:04 +0100 cd  r277853 : #i108012# Check for file size must be done earlier

diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index 29edab3..034cf0b 100644
--- a/sal/osl/unx/file_misc.cxx
+++ b/sal/osl/unx/file_misc.cxx
@@ -1013,6 +1013,15 @@ static int oslDoCopyFile(const sal_Char* pszSourceFileName, const sal_Char* pszD
         return nRet;
     }
  
+    /* HACK: because memory mapping fails on various 
+       platforms if the size of the source file is  0 byte */
+    if (0 == nSourceSize)
+    {						
+        close(SourceFileFD);
+        close(DestFileFD);
+        return 0;
+    }
+
     // read and lseek are used to check the possibility to access the data
     // not a nice solution, but it allows to avoid a crash in case it is an opened samba file
     // generally, reading of one byte should not affect the performance
@@ -1034,15 +1043,6 @@ static int oslDoCopyFile(const sal_Char* pszSourceFileName, const sal_Char* pszD
         return nRet;
     }
 
-    /* HACK: because memory mapping fails on various 
-       platforms if the size of the source file is  0 byte */
-    if (0 == nSourceSize)
-    {						
-        close(SourceFileFD);
-        close(DestFileFD);
-        return 0;
-    }
-
     size_t nWritten = 0;
     size_t nRemains = nSourceSize;
    


More information about the ooo-build-commit mailing list