Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
pass Else directly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Newson committed Feb 17, 2011
1 parent 3ec18b6 commit 9858054
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/monic_file.erl
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ handle_call({write, Bin}, _From, #state{uuid=UUID,eof=Eof,fd=Fd}=State) when is_
write_file_header(Fd, #file_header{uuid=UUID, eof=Eof1}),
{reply, {ok, Handle}, State#state{eof=Eof1}};
Else ->
{reply, {error, Else}, State}
{reply, Else, State}
end;
Else ->
{reply, {error, Else}, State}
{reply, Else, State}
end;
handle_call({write, Fun}, _From, #state{uuid=UUID,eof=Eof,fd=Fd}=State) when is_function(Fun) ->
case stream_in(Fd, Fun, Eof + ?ITEM_HEADER_SIZE) of
Expand All @@ -106,16 +106,16 @@ handle_call({write, Fun}, _From, #state{uuid=UUID,eof=Eof,fd=Fd}=State) when is_
write_file_header(Fd, #file_header{uuid=UUID, eof=Eof2}),
{reply, {ok, Handle}, State#state{eof=Eof2}};
Else ->
{reply, {error, Else}, State}
{reply, Else, State}
end;
Else ->
{reply, {error, Else}, State}
{reply, Else, State}
end;
Else->
{reply, {error, Else}, State}
{reply, Else, State}
end;
Else->
{reply, {error, Else}, State}
{reply, Else, State}
end;
handle_call({read, #handle{uuid=UUID}}, _From, #state{uuid=UUID1}=State) when UUID /= UUID1 ->
{reply, {error, wrong_file}, State};
Expand All @@ -127,7 +127,7 @@ handle_call({read, #handle{location=Location,cookie=Cookie}}, _From, #state{fd=F
{ok, #item_header{}} ->
{reply, {error, invalid_cookie}, State};
Else ->
{reply, {error, Else}, State}
{reply, Else, State}
end;
handle_call({read, Handle, Fun}, From, State) ->
handle_call({read, Handle, [], Fun}, From, State);
Expand Down Expand Up @@ -155,18 +155,18 @@ handle_call({read, #handle{location=Location,cookie=Cookie}, Ranges, Fun}, _From
Fun(eof),
{reply, ok, State};
Else ->
{reply, {error, Else}, State}
{reply, Else, State}
end;
Else ->
{reply, {error, Else}, State}
{reply, Else, State}
end;
Else ->
{reply, {error, Else}, State}
{reply, Else, State}
end;
{ok, #item_header{}} ->
{reply, {error, invalid_cookie}, State};
Else ->
{reply, {error, Else}, State}
{reply, Else, State}
end;
handle_call(close, _From, #state{fd=Fd}=State) ->
{stop, normal, file:close(Fd), State#state{fd=nil}};
Expand Down

0 comments on commit 9858054

Please sign in to comment.