You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by iv...@apache.org on 2015/09/08 11:06:19 UTC
svn commit: r1701749 - /subversion/trunk/subversion/libsvn_subr/io.c
Author: ivan
Date: Tue Sep 8 09:06:18 2015
New Revision: 1701749
URL: http://svn.apache.org/r1701749
Log:
Do not attempt convert arbitrary apr_status_t to OS error to check it for
OS specific codes.
* subversion/libsvn_subr/io.c
(svn_io_open_uniquely_named, svn_io_dir_remove_nonrecursive,
temp_file_create): Use 'apr_err == APR_FROM_OS_ERROR(os_error)' pattern
instead of 'APR_TO_OS_ERROR(apr_err) == os_error'.
Modified:
subversion/trunk/subversion/libsvn_subr/io.c
Modified: subversion/trunk/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/io.c?rev=1701749&r1=1701748&r2=1701749&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/io.c (original)
+++ subversion/trunk/subversion/libsvn_subr/io.c Tue Sep 8 09:06:18 2015
@@ -578,10 +578,8 @@ svn_io_open_uniquely_named(apr_file_t **
continue;
#ifdef WIN32
- apr_err_2 = APR_TO_OS_ERROR(apr_err);
-
- if (apr_err_2 == ERROR_ACCESS_DENIED ||
- apr_err_2 == ERROR_SHARING_VIOLATION)
+ if (apr_err == APR_FROM_OS_ERROR(ERROR_ACCESS_DENIED) ||
+ apr_err == APR_FROM_OS_ERROR(ERROR_SHARING_VIOLATION))
{
/* The file is in use by another process or is hidden;
create a new name, but don't do this 99999 times in
@@ -4442,8 +4440,8 @@ svn_io_dir_remove_nonrecursive(const cha
{
svn_boolean_t retry = TRUE;
- if (APR_TO_OS_ERROR(status) == ERROR_DIR_NOT_EMPTY)
- {
+ if (status == APR_FROM_OS_ERROR(ERROR_DIR_NOT_EMPTY))
+ {
apr_status_t empty_status = dir_is_empty(dirname_apr, pool);
if (APR_STATUS_IS_ENOTEMPTY(empty_status))
@@ -5150,10 +5148,8 @@ temp_file_create(apr_file_t **new_file,
if (!apr_err_2 && finfo.filetype == APR_DIR)
continue;
- apr_err_2 = APR_TO_OS_ERROR(apr_err);
-
- if (apr_err_2 == ERROR_ACCESS_DENIED ||
- apr_err_2 == ERROR_SHARING_VIOLATION)
+ if (apr_err == APR_FROM_OS_ERROR(ERROR_ACCESS_DENIED) ||
+ apr_err == APR_FROM_OS_ERROR(ERROR_SHARING_VIOLATION))
{
/* The file is in use by another process or is hidden;
create a new name, but don't do this 99999 times in