From dca7025f278f6695286c832488e9713bee9a5370 Mon Sep 17 00:00:00 2001 From: Evgeny Kotkov Date: Tue, 20 Aug 2019 09:00:03 +0000 Subject: [PATCH] * subversion/libsvn_subr/io.c (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 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/subversion/libsvn_subr/io.c b/subversion/libsvn_subr/io.c index 285a5555a5..b54ffcb9ff 100644 --- a/subversion/libsvn_subr/io.c +++ b/subversion/libsvn_subr/io.c @@ -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; -- 2.11.4.GIT