Skip to content

Commit

Permalink
Restore non-zero exit code introduced in 26be832 and lost in 13a1709
Browse files Browse the repository at this point in the history
I checked that init:stop/1 was present in OTP R13B03.

Also rename function in a hopefully more meaningful way following
change in 13a1709.
  • Loading branch information
Luca Favatella committed Aug 19, 2014
1 parent abb718f commit ffc2b93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/basho_bench.hrl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

-define(FAIL_MSG(Str, Args), ?ERROR(Str, Args), basho_bench_app:halt_or_kill()).
-define(FAIL_MSG(Str, Args), ?ERROR(Str, Args), basho_bench_app:stop_or_kill()).
-define(STD_ERR(Str, Args), io:format(standard_error, Str, Args)).

-define(CONSOLE(Str, Args), lager:info(Str, Args)).
Expand Down
6 changes: 3 additions & 3 deletions src/basho_bench_app.erl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
-export([start/0,
stop/0,
is_running/0,
halt_or_kill/0]).
stop_or_kill/0]).

%% Application callbacks
-export([start/2, stop/1]).
Expand Down Expand Up @@ -64,14 +64,14 @@ stop() ->
is_running() ->
application:get_env(basho_bench_app, is_running) == {ok, true}.

halt_or_kill() ->
stop_or_kill() ->
%% If running standalone, halt and kill node. Otherwise, just
%% kill top supervisor.
case application:get_env(basho_bench,app_run_mode) of
{ok, included} ->
exit(whereis(basho_bench_sup),kill);
_ ->
init:stop()
init:stop(1)
end.

%% ===================================================================
Expand Down

0 comments on commit ffc2b93

Please sign in to comment.