Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 35D1317585 for ; Fri, 23 Jan 2015 14:01:28 +0000 (UTC) Received: (qmail 93145 invoked by uid 500); 23 Jan 2015 14:01:28 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 93117 invoked by uid 500); 23 Jan 2015 14:01:28 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 93106 invoked by uid 99); 23 Jan 2015 14:01:28 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Jan 2015 14:01:28 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id B2985AC010E; Fri, 23 Jan 2015 14:01:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1654215 - /subversion/trunk/subversion/libsvn_subr/io.c Date: Fri, 23 Jan 2015 14:01:27 -0000 To: commits@subversion.apache.org From: kotkov@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150123140127.B2985AC010E@hades.apache.org> 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)