You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/03/06 14:52:52 UTC

[GitHub] davisp commented on a change in pull request #1164: Fix: Proper error handling for file:open() call in couch_file.erl

davisp commented on a change in pull request #1164: Fix: Proper error handling for file:open() call in couch_file.erl
URL: https://github.com/apache/couchdb/pull/1164#discussion_r172540019
 
 

 ##########
 File path: src/couch/src/couch_file.erl
 ##########
 @@ -213,8 +213,12 @@ truncate(Fd, Pos) ->
 %%----------------------------------------------------------------------
 
 sync(Filepath) when is_list(Filepath) ->
-    {ok, Fd} = file:open(Filepath, [append, raw]),
-    try ok = file:sync(Fd) after ok = file:close(Fd) end;
+    case file:open(Filepath, [append, raw]) of
+      {ok, Fd} ->
 
 Review comment:
   Use four space indents everywhere.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services