Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4DFD19DB7 for ; Wed, 21 Mar 2012 21:43:27 +0000 (UTC) Received: (qmail 52556 invoked by uid 500); 21 Mar 2012 21:43:27 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 52512 invoked by uid 500); 21 Mar 2012 21:43:27 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 52460 invoked by uid 99); 21 Mar 2012 21:43:25 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Mar 2012 21:43:25 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A6CF08563; Wed, 21 Mar 2012 21:43:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: randall@apache.org To: commits@couchdb.apache.org X-Mailer: ASF-Git Admin Mailer Subject: git commit: maintain the file_exists idiom Message-Id: <20120321214325.A6CF08563@tyr.zones.apache.org> Date: Wed, 21 Mar 2012 21:43:25 +0000 (UTC) Updated Branches: refs/heads/1.2.x 25e079117 -> af9e1c883 maintain the file_exists idiom POSIX {error, eexist} from the file module needs to be kept from bubbling all the way to couch_httpd or it will result in a 500 error when a 412 is what we want. This change confines all the "database exists already" conversion of the {error, eexist} that now bubble out of couch_file contained within couch_server. Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/af9e1c88 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/af9e1c88 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/af9e1c88 Branch: refs/heads/1.2.x Commit: af9e1c883ca4accb209cccc7ac9d26efa4daf1fd Parents: 25e0791 Author: Randall Leeds Authored: Wed Mar 21 14:38:53 2012 -0700 Committer: Randall Leeds Committed: Wed Mar 21 14:38:53 2012 -0700 ---------------------------------------------------------------------- src/couchdb/couch_server.erl | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/af9e1c88/src/couchdb/couch_server.erl ---------------------------------------------------------------------- diff --git a/src/couchdb/couch_server.erl b/src/couchdb/couch_server.erl index 1185a20..440af62 100644 --- a/src/couchdb/couch_server.erl +++ b/src/couchdb/couch_server.erl @@ -323,6 +323,8 @@ handle_call({open_result, DbName, {ok, OpenedDbPid}, Options}, _From, Server) -> ok end, {reply, ok, Server}; +handle_call({open_result, DbName, {error, eexist}, Options}, From, Server) -> + handle_call({open_result, DbName, file_exists, Options}, From, Server); handle_call({open_result, DbName, Error, Options}, _From, Server) -> [{DbName, {opening,Opener,Froms}}] = ets:lookup(couch_dbs_by_name, DbName), lists:foreach(fun(From) ->