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

Jan Holesovsky kendy at kemper.freedesktop.org
Fri Jan 22 20:44:45 PST 2010


 sal/osl/unx/file_misc.cxx |   21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

New commits:
commit 7c075c93a2a2e52c052cd0e1ff1008f01f011d7b
Author: Oliver Bolte <obo at openoffice.org>
Date:   Fri Jan 22 13:50:41 2010 +0000

    CWS-TOOLING: integrate CWS calc32stopper9
    2010-01-22 09:34:57 +0100 mav  r277946 : #i108559# copy empty file correctly
    2010-01-22 09:25:03 +0100 mav  r277945 : #i108559# copy empty file correctly

diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index 034cf0b..61016f7 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;
     }
  
+    DestFileFD=open(pszDestFileName, O_WRONLY | O_CREAT, mode);
+        
+    if ( DestFileFD < 0 )
+    {
+        nRet=errno;
+        close(SourceFileFD);
+        return nRet;
+    }
+
     /* HACK: because memory mapping fails on various 
        platforms if the size of the source file is  0 byte */
     if (0 == nSourceSize)
@@ -1030,16 +1039,8 @@ static int oslDoCopyFile(const sal_Char* pszSourceFileName, const sal_Char* pszD
       || -1 == lseek( SourceFileFD, 0, SEEK_SET ) )
     {
         nRet = errno;
-        (void) close( SourceFileFD );
-        return nRet;
-    }
-
-    DestFileFD=open(pszDestFileName, O_WRONLY | O_CREAT, mode);
-        
-    if ( DestFileFD < 0 )
-    {
-        nRet=errno;
-        close(SourceFileFD);
+        close( SourceFileFD );
+        close( DestFileFD );
         return nRet;
     }
 


More information about the ooo-build-commit mailing list