summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2010-09-25 11:26:39 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2010-09-25 11:26:39 +0000
commit0d173b449108658f9e6404a52303a985565b8315 (patch)
tree87cf66aaf5063f5665dc83145e45b6f4fe33d51d /src
parent64f1cadf879be49298a4364c15c308a1ac98123c (diff)
Explicitely close the file descriptor. It doesn't hurt.
Also, since we open the file in 'raw' mode, I suspect the file descriptor is not closed when the couch_file server dies. From erl -man file: "The raw option allows faster access to a file, because no Erlang process is needed to handle the file." For me, no Erlang process handling the file means that it's likely the file is not closed by any other process. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1001196 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/couchdb/couch_file.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/couchdb/couch_file.erl b/src/couchdb/couch_file.erl
index aae89d7f..860c9f4e 100644
--- a/src/couchdb/couch_file.erl
+++ b/src/couchdb/couch_file.erl
@@ -278,8 +278,8 @@ maybe_track_open_os_files(FileOptions) ->
couch_stats_collector:track_process_count({couchdb, open_os_files})
end.
-terminate(_Reason, _Fd) ->
- ok.
+terminate(_Reason, #file{fd = Fd}) ->
+ ok = file:close(Fd).
handle_call({pread_iolist, Pos}, _From, File) ->