summaryrefslogtreecommitdiff
path: root/sal/osl/unx/file_misc.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-03-07 18:53:55 +0100
committerMichael Stahl <mstahl@redhat.com>2016-03-07 18:56:34 +0100
commita2fb2cfd45452512fb1d3e79b3cc1f4c7cef2e77 (patch)
treefb550d1b634ddae9a5078ed8604ae23ad0118fd4 /sal/osl/unx/file_misc.cxx
parenta95c02314202b41bfac5555b68f97018adca31d4 (diff)
sal: UNX: in oslDoCopy, rename into destination directory ...
... not into the source one as that will likely fail with EXDEV if source and target are on different mounts => osl_File_E_EXIST. This broke the xmlsecurity test SigningTest::testOOXMLAppend(). Change-Id: I07ada1d5564fd72a059d588e127a5906a499aca4
Diffstat (limited to 'sal/osl/unx/file_misc.cxx')
-rw-r--r--sal/osl/unx/file_misc.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index 7f3356ec4f40..3c0ea7751464 100644
--- a/sal/osl/unx/file_misc.cxx
+++ b/sal/osl/unx/file_misc.cxx
@@ -803,7 +803,8 @@ static oslFileError oslDoCopy(const sal_Char* pszSourceFileName, const sal_Char*
if ( DestFileExists )
{
//TODO: better pick a temp file name instead of adding .osl-tmp:
- tmpDestFile = rtl::OString(pszSourceFileName) + ".osl-tmp";
+ // use the destination file to avoid EXDEV /* Cross-device link */
+ tmpDestFile = rtl::OString(pszDestFileName) + ".osl-tmp";
if (rename(pszDestFileName, tmpDestFile.getStr()) != 0)
{
if (errno == ENOENT)