summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2010-01-29 14:07:38 +0100
committerIvo Hinkelmann <ihi@openoffice.org>2010-01-29 14:07:38 +0100
commit7733a21c3a267cf252fc541391db2a15a999740e (patch)
tree5b8981b1b8394522fec627f31beab63aea7d0b77
parentcfb935deebfded6b459b4f8d49975b923c03a8b6 (diff)
parenta4919d0a2ad205a6c3bbcc63024710658bf18b71 (diff)
CWS-TOOLING: integrate CWS calc32stopper9_DEV300
-rw-r--r--sal/osl/unx/file_misc.cxx21
1 files changed, 11 insertions, 10 deletions
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index 034cf0b9a..61016f796 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;
}