summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/file_handle_cache.erl36
-rw-r--r--src/supervisor2.erl4
2 files changed, 20 insertions, 20 deletions
diff --git a/src/file_handle_cache.erl b/src/file_handle_cache.erl
index 59bb01bf13..929671cd98 100644
--- a/src/file_handle_cache.erl
+++ b/src/file_handle_cache.erl
@@ -332,19 +332,18 @@ truncate(Ref) ->
with_flushed_handles(
[Ref],
fun ([Handle1 = #handle { hdl = Hdl, offset = Offset,
- trusted_offset = TrustedOffset }]) ->
+ trusted_offset = TOffset }]) ->
case file:truncate(Hdl) of
- ok -> TrustedOffset1 = lists:min([Offset, TrustedOffset]),
- {ok, [Handle1 #handle {
- at_eof = true,
- trusted_offset = TrustedOffset1 }]};
+ ok -> TOffset1 = lists:min([Offset, TOffset]),
+ {ok, [Handle1 #handle {at_eof = true,
+ trusted_offset = TOffset1 }]};
Error -> {Error, [Handle1]}
end
end).
last_sync_offset(Ref) ->
- with_handles([Ref], fun ([#handle { trusted_offset = TrustedOffset }]) ->
- {ok, TrustedOffset}
+ with_handles([Ref], fun ([#handle { trusted_offset = TOffset }]) ->
+ {ok, TOffset}
end).
current_virtual_offset(Ref) ->
@@ -476,7 +475,7 @@ with_handles(Refs, Fun) ->
end, {ok, []}, Refs),
case ResHandles of
{ok, Handles} ->
- case erlang:apply(Fun, [lists:reverse(Handles)]) of
+ case Fun(lists:reverse(Handles)) of
{Result, Handles1} when is_list(Handles1) ->
lists:zipwith(fun put_handle/2, Refs, Handles1),
Result;
@@ -499,7 +498,7 @@ with_flushed_handles(Refs, Fun) ->
{Error, [Handle | HandlesAcc]}
end, {ok, []}, Handles) of
{ok, Handles1} ->
- erlang:apply(Fun, [lists:reverse(Handles1)]);
+ Fun(lists:reverse(Handles1));
{Error, Handles1} ->
{Error, lists:reverse(Handles1)}
end
@@ -545,14 +544,14 @@ open1(Path, Mode, Options, Ref, Offset, NewOrReopen) ->
N when is_integer(N) -> N
end,
Now = now(),
- Handle =
- #handle { hdl = Hdl, offset = 0, trusted_offset = 0,
- write_buffer_size = 0, options = Options,
- write_buffer_size_limit = WriteBufferSize,
- write_buffer = [], at_eof = false, mode = Mode,
- is_write = is_writer(Mode), is_read = is_reader(Mode),
- path = Path, last_used_at = Now,
- is_dirty = false },
+ Handle = #handle { hdl = Hdl, offset = 0, trusted_offset = 0,
+ write_buffer_size = 0, options = Options,
+ write_buffer_size_limit = WriteBufferSize,
+ write_buffer = [], at_eof = false, mode = Mode,
+ is_write = is_writer(Mode),
+ is_read = is_reader(Mode),
+ path = Path, last_used_at = Now,
+ is_dirty = false },
{{ok, Offset1}, Handle1} = maybe_seek(Offset, Handle),
Handle2 = Handle1 #handle { trusted_offset = Offset1 },
put({Ref, fhc_handle}, Handle2),
@@ -844,5 +843,6 @@ ensure_mref(Pid, State = #fhc_state { client_mrefs = ClientMRefs }) ->
ensure_mref(Pid, ClientMRefs) ->
case dict:find(Pid, ClientMRefs) of
{ok, _MRef} -> ClientMRefs;
- error -> dict:store(Pid, erlang:monitor(process, Pid), ClientMRefs)
+ error -> dict:store(Pid, erlang:monitor(process, Pid),
+ ClientMRefs)
end.
diff --git a/src/supervisor2.erl b/src/supervisor2.erl
index 978d30f9a6..5575351269 100644
--- a/src/supervisor2.erl
+++ b/src/supervisor2.erl
@@ -5,8 +5,8 @@
%%
%% 2) there is a new strategy called
%% simple_one_for_one_terminate. This is exactly the same as for
-%% simple_one_for_one, except that children *are* explicitly killed as
-%% per the shutdown component of the child_spec.
+%% simple_one_for_one, except that children *are* explicitly
+%% terminated as per the shutdown component of the child_spec.
%%
%% All modifications are (C) 2010 LShift Ltd.
%%