diff options
author | John Christopher Anderson <jchris@apache.org> | 2010-03-04 03:10:19 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2010-03-04 03:10:19 +0000 |
commit | d318717866ffa267781ab482e99a05415e2ac0e4 (patch) | |
tree | 207409d78eacca8e206deb05b99689ec449722a4 /src/couchdb/couch_file.erl | |
parent | 3a3a9c1efab1c9fe4cd5ebb6c80da4005eb0806b (diff) |
reverting damien's latest commit until we can figure out why it's causing failures
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@918834 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_file.erl')
-rw-r--r-- | src/couchdb/couch_file.erl | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/couchdb/couch_file.erl b/src/couchdb/couch_file.erl index 4c6928a7..5904260c 100644 --- a/src/couchdb/couch_file.erl +++ b/src/couchdb/couch_file.erl @@ -176,21 +176,13 @@ sync(Fd) -> gen_server:call(Fd, sync, infinity). %%---------------------------------------------------------------------- -%% Purpose: Close the file. +%% Purpose: Close the file. Is performed asynchronously. %% Returns: ok %%---------------------------------------------------------------------- close(Fd) -> - MRef = erlang:monitor(process, Fd), - try - catch unlink(Fd), - catch exit(Fd, shutdown), - receive - {'DOWN', MRef, _, _, _} -> - ok - end - after - erlang:demonitor(MRef, [flush]) - end. + Result = gen_server:cast(Fd, close), + catch unlink(Fd), + Result. % 09 UPGRADE CODE old_pread(Fd, Pos, Len) -> @@ -227,7 +219,6 @@ init_status_error(ReturnPid, Ref, Error) -> % server functions init({Filepath, Options, ReturnPid, Ref}) -> - process_flag(trap_exit, true), case lists:member(create, Options) of true -> filelib:ensure_dir(Filepath), @@ -441,8 +432,6 @@ handle_cast(close, Fd) -> code_change(_OldVsn, State, _Extra) -> {ok, State}. -handle_info({'EXIT', _, normal}, Fd) -> - {noreply, Fd}; handle_info({'EXIT', _, Reason}, Fd) -> {stop, Reason, Fd}. |