couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject svn commit: r1150915 - in /couchdb/trunk/src/couchdb: couch_db_updater.erl couch_file.erl couch_server_sup.erl
Date Mon, 25 Jul 2011 21:13:06 GMT
Author: rnewson
Date: Mon Jul 25 21:13:05 2011
New Revision: 1150915

URL: http://svn.apache.org/viewvc?rev=1150915&view=rev
Log:
assert that calls to file functions actually succeed.

Modified:
    couchdb/trunk/src/couchdb/couch_db_updater.erl
    couchdb/trunk/src/couchdb/couch_file.erl
    couchdb/trunk/src/couchdb/couch_server_sup.erl

Modified: couchdb/trunk/src/couchdb/couch_db_updater.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_db_updater.erl?rev=1150915&r1=1150914&r2=1150915&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_db_updater.erl (original)
+++ couchdb/trunk/src/couchdb/couch_db_updater.erl Mon Jul 25 21:13:05 2011
@@ -49,8 +49,8 @@ init({MainPid, DbName, Filepath, Fd, Opt
 
 
 terminate(_Reason, Db) ->
-    couch_file:close(Db#db.updater_fd),
-    couch_file:close(Db#db.fd),
+    ok = couch_file:close(Db#db.updater_fd),
+    ok = couch_file:close(Db#db.fd),
     couch_util:shutdown_sync(Db#db.compactor_pid),
     couch_util:shutdown_sync(Db#db.fd_ref_counter),
     ok.

Modified: couchdb/trunk/src/couchdb/couch_file.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_file.erl?rev=1150915&r1=1150914&r2=1150915&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_file.erl (original)
+++ couchdb/trunk/src/couchdb/couch_file.erl Mon Jul 25 21:13:05 2011
@@ -183,7 +183,7 @@ truncate(Fd, Pos) ->
 
 sync(Filepath) when is_list(Filepath) ->
     {ok, Fd} = file:open(Filepath, [append, raw]),
-    try file:sync(Fd) after file:close(Fd) end;
+    try ok = file:sync(Fd) after ok = file:close(Fd) end;
 sync(Fd) ->
     gen_server:call(Fd, sync, infinity).
 

Modified: couchdb/trunk/src/couchdb/couch_server_sup.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_server_sup.erl?rev=1150915&r1=1150914&r2=1150915&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_server_sup.erl (original)
+++ couchdb/trunk/src/couchdb/couch_server_sup.erl Mon Jul 25 21:13:05 2011
@@ -119,7 +119,7 @@ start_server(IniFiles) ->
             undefined -> [];
             Uri -> io_lib:format("~s~n", [Uri])
             end end || Uri <- Uris],
-        file:write_file(UriFile, Lines)
+        ok = file:write_file(UriFile, Lines)
     end,
 
     {ok, Pid}.



Mime
View raw message