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
commit30ec286882d23af66889ca836e2bef5ae146dbf6 (patch)
tree3bf4c6566861edeac19e6b2c066b842e5029863e
parentea4622dcf7aeec09e7820fbb847467c6a633335d (diff)
parentf3448fafc37127cf89025f6293e8b18b8909b99e (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 0bde1616f6ae..7d797c2be226 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;
}