diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-10-31 13:45:57 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-10-31 13:45:57 +0100 |
commit | ac7c79a82fc8768b2564ef7f20bff38db6946c9b (patch) | |
tree | 6835a6fbe0978e5990fa5c268269ae6f5ec168bb /sal | |
parent | 30c9034c87b6cbc93a5ff4cf7e3fc9bff59b9ac5 (diff) |
cid#982171 Warn about rename failure in error clean-up code
Change-Id: I02e81d526c07297a5bc3664cc475302a552187eb
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/file_misc.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx index 597349d5cb65..7873783753e3 100644 --- a/sal/osl/unx/file_misc.cxx +++ b/sal/osl/unx/file_misc.cxx @@ -843,7 +843,14 @@ static oslFileError oslDoCopy(const sal_Char* pszSourceFileName, const sal_Char* if ( nRet > 0 && DestFileExists == 1 ) { unlink(pszDestFileName); - rename(tmpDestFile.getStr(), pszDestFileName); + if (rename(tmpDestFile.getStr(), pszDestFileName) != 0) + { + int e = errno; + SAL_WARN( + "sal.osl", + "rename(" << tmpDestFile << ", " << pszDestFileName + << ") failed with errno " << e); + } } if ( nRet > 0 ) |