* subversion/libsvn_subr/io.c
authorEvgeny Kotkov <[email protected]>
Tue, 20 Aug 2019 09:00:03 +0000 (20 09:00 +0000)
committerEvgeny Kotkov <[email protected]>
Tue, 20 Aug 2019 09:00:03 +0000 (20 09:00 +0000)
  (win32_file_rename): Rename `status` to `err`. This lays the groundwork for
   fixing the incorrect error status being propagated to the caller in case
   where we fail to stat the destination path while being in the middle of
   a failed rename.

git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1865519 13f79535-47bb-0310-9956-ffa450edef68

subversion/libsvn_subr/io.c

index 285a555..b54ffcb 100644 (file)
@@ -4492,17 +4492,17 @@ win32_file_rename(const WCHAR *from_path_w,
 
   if (!MoveFileExW(from_path_w, to_path_w, flags))
     {
-      apr_status_t status = apr_get_os_error();
+      apr_status_t err = apr_get_os_error();
       /* If the target file is read only NTFS reports EACCESS and
          FAT/FAT32 reports EEXIST */
-      if (APR_STATUS_IS_EACCES(status) || APR_STATUS_IS_EEXIST(status))
+      if (APR_STATUS_IS_EACCES(err) || APR_STATUS_IS_EEXIST(err))
         {
           DWORD attrs = GetFileAttributesW(to_path_w);
           if (attrs == INVALID_FILE_ATTRIBUTES)
             {
-              status = apr_get_os_error();
-              if (!(APR_STATUS_IS_ENOENT(status) || SVN__APR_STATUS_IS_ENOTDIR(status)))
-                return status;
+              err = apr_get_os_error();
+              if (!(APR_STATUS_IS_ENOENT(err) || SVN__APR_STATUS_IS_ENOTDIR(err)))
+                return err;
             }
           else if (attrs & FILE_ATTRIBUTE_READONLY)
             {
@@ -4512,9 +4512,9 @@ win32_file_rename(const WCHAR *from_path_w,
               attrs &= ~FILE_ATTRIBUTE_READONLY;
               if (!SetFileAttributesW(to_path_w, attrs))
                 {
-                  status = apr_get_os_error();
-                  if (!(APR_STATUS_IS_ENOENT(status) || SVN__APR_STATUS_IS_ENOTDIR(status)))
-                    return status;
+                  err = apr_get_os_error();
+                  if (!(APR_STATUS_IS_ENOENT(err) || SVN__APR_STATUS_IS_ENOTDIR(err)))
+                    return err;
                 }
             }
 
@@ -4526,7 +4526,7 @@ win32_file_rename(const WCHAR *from_path_w,
             return apr_get_os_error();
         }
       else
-        return status;
+        return err;
     }
 
   return APR_SUCCESS;