summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-10-10 14:44:22 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-10-10 15:48:56 +0200
commitf06091b8f1a6a9da769f1224d7f7caa4f166c85f (patch)
treea46aecd32abdcf03bbd56d6eeb4a9c6b0fe95dfd /sal
parenta7e59449cc7222a1d3edf66b3d8f8efd5541827d (diff)
DestFileExists should be bool
Change-Id: I5803aa2498654c579f9fe6293e5204aa63edd589 Reviewed-on: https://gerrit.libreoffice.org/80607 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/file_misc.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index 67ba37f6f7e1..ce9eee8ec1c0 100644
--- a/sal/osl/unx/file_misc.cxx
+++ b/sal/osl/unx/file_misc.cxx
@@ -582,7 +582,7 @@ static oslFileError osl_unlinkFile(const sal_Char* pszPath);
static oslFileError osl_psz_copyFile(const sal_Char* pszPath, const sal_Char* pszDestPath, bool preserveMetadata);
static oslFileError osl_psz_moveFile(const sal_Char* pszPath, const sal_Char* pszDestPath);
-static oslFileError oslDoCopy(const sal_Char* pszSourceFileName, const sal_Char* pszDestFileName, mode_t nMode, size_t nSourceSize, int DestFileExists);
+static oslFileError oslDoCopy(const sal_Char* pszSourceFileName, const sal_Char* pszDestFileName, mode_t nMode, size_t nSourceSize, bool DestFileExists);
static void attemptChangeMetadata(const sal_Char* pszFileName, mode_t nMode, time_t nAcTime, time_t nModTime, uid_t nUID, gid_t nGID);
static int oslDoCopyLink(const sal_Char* pszSourceFileName, const sal_Char* pszDestFileName);
static int oslDoCopyFile(const sal_Char* pszSourceFileName, const sal_Char* pszDestFileName, size_t nSourceSize, mode_t mode);
@@ -776,7 +776,7 @@ static oslFileError osl_psz_copyFile( const sal_Char* pszPath, const sal_Char* p
struct stat aFileStat;
oslFileError tErr=osl_File_E_invalidError;
size_t nSourceSize=0;
- int DestFileExists=1;
+ bool DestFileExists=true;
/* mfe: does the source file really exists? */
nRet = lstat_c(pszPath,&aFileStat);
@@ -808,11 +808,11 @@ static oslFileError osl_psz_copyFile( const sal_Char* pszPath, const sal_Char* p
// "/private/var/mobile/Library/Mobile Documents/com~apple~CloudDocs/helloodt0.odt" fails
// with EPERM, not ENOENT.
if (nRet == EPERM)
- DestFileExists=0;
+ DestFileExists=false;
#endif
if (nRet == ENOENT)
- DestFileExists=0;
+ DestFileExists=false;
}
/* mfe: the destination file must not be a directory! */
@@ -832,7 +832,7 @@ static oslFileError osl_psz_copyFile( const sal_Char* pszPath, const sal_Char* p
return tErr;
}
-static oslFileError oslDoCopy(const sal_Char* pszSourceFileName, const sal_Char* pszDestFileName, mode_t nMode, size_t nSourceSize, int DestFileExists)
+static oslFileError oslDoCopy(const sal_Char* pszSourceFileName, const sal_Char* pszDestFileName, mode_t nMode, size_t nSourceSize, bool DestFileExists)
{
int nRet=0;
@@ -849,7 +849,7 @@ static oslFileError oslDoCopy(const sal_Char* pszSourceFileName, const sal_Char*
<< "): " << UnixErrnoString(e));
if (e == ENOENT)
{
- DestFileExists = 0;
+ DestFileExists = false;
}
else
{
@@ -880,7 +880,7 @@ static oslFileError oslDoCopy(const sal_Char* pszSourceFileName, const sal_Char*
nRet=ENOSYS;
}
- if ( nRet > 0 && DestFileExists == 1 )
+ if ( nRet > 0 && DestFileExists )
{
if (unlink(pszDestFileName) != 0)
{
@@ -905,7 +905,7 @@ static oslFileError oslDoCopy(const sal_Char* pszSourceFileName, const sal_Char*
return oslTranslateFileError(nRet);
}
- if ( DestFileExists == 1 )
+ if ( DestFileExists )
{
unlink(tmpDestFile.getStr());
}