[Libreoffice-commits] core.git: sal/osl

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Thu Oct 10 13:49:40 UTC 2019


 sal/osl/unx/file_misc.cxx |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit f06091b8f1a6a9da769f1224d7f7caa4f166c85f
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Oct 10 14:44:22 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Oct 10 15:48:56 2019 +0200

    DestFileExists should be bool
    
    Change-Id: I5803aa2498654c579f9fe6293e5204aa63edd589
    Reviewed-on: https://gerrit.libreoffice.org/80607
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

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());
     }


More information about the Libreoffice-commits mailing list