summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_file.erl
diff options
context:
space:
mode:
authorDamien F. Katz <damien@apache.org>2008-12-18 21:43:34 +0000
committerDamien F. Katz <damien@apache.org>2008-12-18 21:43:34 +0000
commit2a6ad51f1acd4cae30a6e976d00444a1a6931702 (patch)
tree9f501a26ca689cf3b237a0cfe4966a768b008603 /src/couchdb/couch_file.erl
parent6cc0a3fcaddb3094f8f0fcd5bd51b3e74e70d11c (diff)
fix for crash of couch_server when database non-existant
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@727832 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_file.erl')
-rw-r--r--src/couchdb/couch_file.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/couchdb/couch_file.erl b/src/couchdb/couch_file.erl
index 4ed9dc05..06156324 100644
--- a/src/couchdb/couch_file.erl
+++ b/src/couchdb/couch_file.erl
@@ -40,7 +40,11 @@ open(Filepath, Options) ->
ignore ->
% get the error
receive
- {Ref, Error} ->
+ {Ref, Pid, Error} ->
+ case process_info(self(), trap_exit) of
+ {trap_exit, true} -> receive {'EXIT', Pid, _} -> ok end;
+ {trap_exit, false} -> ok
+ end,
Error
end;
Error ->
@@ -276,7 +280,7 @@ extract_header(Prefix, Bin) ->
init_status_error(ReturnPid, Ref, Error) ->
- ReturnPid ! {Ref, Error},
+ ReturnPid ! {Ref, self(), Error},
ignore.
% server functions