From e37623a84c4565aa641964725eb7c9a2a73ad91d Mon Sep 17 00:00:00 2001 From: Kresten Krab Thorup Date: Fri, 14 Feb 2014 08:25:26 -0500 Subject: [PATCH] Fix argument order for plain_fsm:handle_system_msg plain_fsm documentation was wrong https://github.com/uwiger/plain_fsm/pull/4, so now it should be able to send sys messages to hanoi. --- src/hanoidb_fold_worker.erl | 4 ++-- src/hanoidb_level.erl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hanoidb_fold_worker.erl b/src/hanoidb_fold_worker.erl index 5ee9dcf..e48b160 100644 --- a/src/hanoidb_fold_worker.erl +++ b/src/hanoidb_fold_worker.erl @@ -102,7 +102,7 @@ initialize(State, PrefixFolders) -> %% gen_fsm handling {system, From, Req} -> plain_fsm:handle_system_msg( - From, Req, State, fun(S1) -> initialize(S1, PrefixFolders) end); + Req, From, State, fun(S1) -> initialize(S1, PrefixFolders) end); {'DOWN', MRef, _, _, _} when MRef =:= State#state.sendto_ref -> ok; @@ -164,7 +164,7 @@ fill_from_inbox(State, Values, Queues, [PID|_]=PIDs, SavePIDs) -> %% gen_fsm handling {system, From, Req} -> plain_fsm:handle_system_msg( - From, Req, State, fun(S1) -> fill_from_inbox(S1, Values, Queues, PIDs, SavePIDs) end); + Req, From, State, fun(S1) -> fill_from_inbox(S1, Values, Queues, PIDs, SavePIDs) end); {'DOWN', MRef, _, _, _} when MRef =:= State#state.sendto_ref -> ok; diff --git a/src/hanoidb_level.erl b/src/hanoidb_level.erl index fa633fc..52e4696 100644 --- a/src/hanoidb_level.erl +++ b/src/hanoidb_level.erl @@ -632,7 +632,7 @@ main_loop(State = #state{ next=Next }) -> %% gen_fsm handling {system, From, Req} -> plain_fsm:handle_system_msg( - From, Req, State, fun(S1) -> main_loop(S1) end); + Req, From, State, fun(S1) -> main_loop(S1) end); {'EXIT', Parent, Reason} -> plain_fsm:parent_EXIT(Reason, State);