summaryrefslogtreecommitdiff
path: root/sal/osl/unx
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2010-01-21 12:06:31 +0100
committersb <sb@openoffice.org>2010-01-21 12:06:31 +0100
commit368990f054d6caf666374d23e230a2b5dc2e87b7 (patch)
treed5979e4872a45c1c43eda6df98116875dd30f88c /sal/osl/unx
parent9ce3f07dc735e37889c040c6064136de783ef54e (diff)
parenta2cadf4bc167c9a5ad534af03f7960c6ef477c05 (diff)
sb118: merged in DEV300_m70
Diffstat (limited to 'sal/osl/unx')
-rw-r--r--sal/osl/unx/file_misc.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index b9b2b6a23c7d..0bde1616f6ae 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;