some fixes #10

Merged
yamt merged 2 commits from fixes into master 2012-09-12 10:00:25 +00:00

View file

@ -439,10 +439,10 @@ main_loop(State = #state{ next=Next }) ->
?log("init_range_fold ~p -> ~p", [Range, WorkerPID]),
{FoldingPIDs, NextList} =
{NextList, FoldingPIDs} =
case {State#state.a, State#state.b, State#state.c} of
{undefined, undefined, undefined} ->
{[], List};
{List, []};
{_, undefined, undefined} ->
ok = file:make_link(filename("A", State), filename("AF", State)),
@ -821,7 +821,7 @@ start_range_fold(FileName, WorkerPID, Range, State) ->
Owner = self(),
PID = proc_lib:spawn( fun() ->
try
?log("start_range_fold ~p on ~p -> ~p", [self, FileName, WorkerPID]),
?log("start_range_fold ~p on ~p -> ~p", [self(), FileName, WorkerPID]),
erlang:link(WorkerPID),
{ok, File} = hanoidb_reader:open(FileName, [folding|State#state.opts]),
do_range_fold2(File, WorkerPID, self(), Range),