subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kot...@apache.org
Subject svn commit: r1654215 - /subversion/trunk/subversion/libsvn_subr/io.c
Date Fri, 23 Jan 2015 14:01:27 GMT
Author: kotkov
Date: Fri Jan 23 14:01:26 2015
New Revision: 1654215

URL: http://svn.apache.org/r1654215
Log:
Simplify the WIN32-specific part of svn_io_remove_file2() by removing the
inner scope.

* subversion/libsvn_subr/io.c
  (svn_io_remove_file2): Drop the local variable 'apr_status_t os_err' in
   favor of a single conditional statement.  After that, remove the inner
   scope, which is no longer unnecessary.

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=1654215&r1=1654214&r2=1654215&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/io.c (original)
+++ subversion/trunk/subversion/libsvn_subr/io.c Fri Jan 23 14:01:26 2015
@@ -2471,23 +2471,20 @@ svn_io_remove_file2(const char *path,
         return SVN_NO_ERROR;
     }
 
+  /* Check to make sure we aren't trying to delete a directory */
+  if (apr_err == APR_FROM_OS_ERROR(ERROR_ACCESS_DENIED)
+      || apr_err == APR_FROM_OS_ERROR(ERROR_SHARING_VIOLATION))
     {
-      apr_status_t os_err = APR_TO_OS_ERROR(apr_err);
-      /* Check to make sure we aren't trying to delete a directory */
-      if (os_err == ERROR_ACCESS_DENIED || os_err == ERROR_SHARING_VIOLATION)
-        {
-          apr_finfo_t finfo;
+      apr_finfo_t finfo;
 
-          if (!apr_stat(&finfo, path_apr, APR_FINFO_TYPE, scratch_pool)
-              && finfo.filetype == APR_REG)
-            {
-              WIN32_RETRY_LOOP(apr_err, apr_file_remove(path_apr,
-                                                        scratch_pool));
-            }
+      if (!apr_stat(&finfo, path_apr, APR_FINFO_TYPE, scratch_pool)
+          && finfo.filetype == APR_REG)
+        {
+          WIN32_RETRY_LOOP(apr_err, apr_file_remove(path_apr, scratch_pool));
         }
-
-      /* Just return the delete error */
     }
+
+  /* Just return the delete error */
 #endif
 
   if (!apr_err)



Mime
View raw message