https://bugs.documentfoundation.org/show_bug.cgi?id=142302
jmul...@yahoo.com changed:
What|Removed |Added
Ever confirmed|1 |0
Status|NEEDINFO|UNCONFIRMED
--- Comment #3 from jmul...@yahoo.com ---
It'll be one of these four places, none of which handle EXDEV
(from fresh git clone)
./sal/osl/unx/file_misc.cxx:754:int nRet = rename(pszPath,pszDestPath);
./sal/osl/unx/file_misc.cxx:845:if (rename(pszDestFileName,
tmpDestFile.getStr()) != 0)
./sal/osl/unx/file_misc.cxx:893:if (rename(tmpDestFile.getStr(),
pszDestFileName) != 0)
./sal/osl/unx/profile.cxx:1720:bool result = rename( pProfile->m_FileName,
pszBakFile ) == 0;
./sal/osl/unx/profile.cxx:1729:result = rename( pszTmpFile,
pProfile->m_FileName ) == 0;
./codemaker/source/codemaker/global.cxx:198:if (
!rename(tmpFileName.getStr(), targetFileName.getStr()) )
./codemaker/source/codemaker/global.cxx:207:if (
rename(tmpFileName.getStr(), targetFileName.getStr()) ) {
sal/osl/unx/file_misc.cxx
e994b3fc3b2c9 (Noel Grandin 2019-12-19 13:29:13 +0200 752) static
oslFileError osl_psz_moveFile(const char* pszPath, const char* pszDestPath)
b76cb86eaa0ae (Oliver Bolte 2009-09-09 09:38:41 + 753) {
acb0cdeedafc5 (Noel Grandin 2019-04-13 14:57:07 +0200 754) int
nRet = rename(pszPath,pszDestPath);
b76cb86eaa0ae (Oliver Bolte 2009-09-09 09:38:41 + 755)
2de83d5ad256d (Chris Sherlock 2018-01-29 02:11:50 +1100 756) if
(nRet < 0)
b76cb86eaa0ae (Oliver Bolte 2009-09-09 09:38:41 + 757) {
sal/osl/unx/file_misc.cxx
e994b3fc3b2c9 (Noel Grandin 2019-12-19 13:29:13 +0200 835) static
oslFileError oslDoCopy(const char* pszSourceFileName, const char*
pszDestFileName, mode
_t nMode, size_t nSourceSize, bool DestFileExists)
b76cb86eaa0ae (Oliver Bolte 2009-09-09 09:38:41 + 836) {
b76cb86eaa0ae (Oliver Bolte 2009-09-09 09:38:41 + 837) int
nRet=0;
b76cb86eaa0ae (Oliver Bolte 2009-09-09 09:38:41 + 838)
6f50961e69406 (Noel Grandin 2018-10-23 12:06:00 +0200 839) OString
tmpDestFile;
b76cb86eaa0ae (Oliver Bolte 2009-09-09 09:38:41 + 840) if (
DestFileExists )
b76cb86eaa0ae (Oliver Bolte 2009-09-09 09:38:41 + 841) {
6edbcc1b231fe (Stephan Bergmann 2014-10-31 12:05:25 +0100 842)
//TODO: better pick a temp file name instead of adding .osl-tmp:
a2fb2cfd45452 (Michael Stahl2016-03-07 18:53:55 +0100 843) //
use the destination file to avoid EXDEV /* Cross-device link */
7049328fb2d65 (Noel Grandin 2021-04-20 21:07:42 +0200 844)
tmpDestFile = pszDestFileName + OString::Concat(".osl-tmp");
30c9034c87b6c (Stephan Bergmann 2014-10-31 13:26:22 +0100 845) if
(rename(pszDestFileName, tmpDestFile.getStr()) != 0)
sal/osl/unx/profile.cxx
ebb4ac785f9d5 (Stephan Bergmann 2014-03-06 14:31:10 +0100 1705) static bool
osl_ProfileSwapProfileNames(osl_TProfileImpl* pProfile
^9399c662f36c (Jens-Heiner Rech 2000-09-18 14:18:43 + 1706) {
e994b3fc3b2c9 (Noel Grandin 2019-12-19 13:29:13 +0200 1707) char
pszBakFile[PATH_MAX];
e994b3fc3b2c9 (Noel Grandin 2019-12-19 13:29:13 +0200 1708) char
pszTmpFile[PATH_MAX];
ad0bdc51df262 (mfe 2001-02-26 15:17:50 + 1709)
ad0bdc51df262 (mfe 2001-02-26 15:17:50 + 1710)
pszBakFile[0] = '\0';
ad0bdc51df262 (mfe 2001-02-26 15:17:50 + 1711)
pszTmpFile[0] = '\0';
^9399c662f36c (Jens-Heiner Rech 2000-09-18 14:18:43 + 1712)
8f210c26c53cf (Stephan Bergmann 2014-03-04 13:47:20 +0100 1713)
osl_ProfileGenerateExtension(pProfile->m_FileName, "bak", pszB
8f210c26c53cf (Stephan Bergmann 2014-03-04 13:47:20 +0100 1714)
osl_ProfileGenerateExtension(pProfile->m_FileName, "tmp", pszT
^9399c662f36c (Jens-Heiner Rech 2000-09-18 14:18:43 + 1715)
52066e4726436 (Norbert Thiebaud 2013-06-20 14:26:49 -0500 1716) /*
unlink bak */
52066e4726436 (Norbert Thiebaud 2013-06-20 14:26:49 -0500 1717) unlink(
pszBakFile );
^9399c662f36c (Jens-Heiner Rech 2000-09-18 14:18:43 + 1718)
ebb4ac785f9d5 (Stephan Bergmann 2014-03-06 14:31:10 +0100 1719) //
Rename ini -> bak, then tmp -> ini:
f8c77cf7ebaf6 (Tor Lillqvist2018-10-12 03:06:27 +0300 1720) bool
result = rename( pProfile->m_FileName, pszBakFile ) == 0;
f8c77cf7ebaf6 (Tor Lillqvist2018-10-12 03:06:27 +0300 1721) if
(!result)
f8c77cf7ebaf6 (Tor Lillqvist2018-10-12 03:06:27 +0300 1722) {
f8c77cf7ebaf6 (Tor Lillqvist2018-10-12 03:06:27 +0300 1723) int
e = errno;
22a2ed832bae5 (Tor Lillqvist2018-10-18 14:30:42 +0300 1724)
SAL_INFO("sal.file", "rename(" <<