diff options
author | sb <sb@openoffice.org> | 2010-02-05 09:17:48 +0100 |
---|---|---|
committer | sb <sb@openoffice.org> | 2010-02-05 09:17:48 +0100 |
commit | aa9dc200bd9dc4e816dae0adde3dc173a75181fd (patch) | |
tree | 4b008cfa816a5b2d03cbf92ef3acd69984a707b6 /sal | |
parent | 5f82c476105b0c6519f3d1bc29851dc15629bf67 (diff) | |
parent | cb6dc8c0cbadd25385d581c0dd3583afc10fd26a (diff) |
sb111: merged in DEV300_m71
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/file_misc.cxx | 21 |
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; } |