summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--src/rabbit_control.erl19
-rw-r--r--src/rabbit_misc.erl9
-rw-r--r--src/rabbit_plugin.erl9
4 files changed, 17 insertions, 21 deletions
diff --git a/Makefile b/Makefile
index 58ca8baa88..2ef1bf027e 100644
--- a/Makefile
+++ b/Makefile
@@ -152,6 +152,7 @@ $(BASIC_PLT): $(BEAM_TARGETS)
clean:
rm -f $(EBIN_DIR)/*.beam
rm -f $(EBIN_DIR)/rabbit.app $(EBIN_DIR)/rabbit.boot $(EBIN_DIR)/rabbit.script $(EBIN_DIR)/rabbit.rel
+ rm -f provided_plugins/*.ez
rm -f $(INCLUDE_DIR)/rabbit_framing.hrl $(SOURCE_DIR)/rabbit_framing_amqp_*.erl codegen.pyc
rm -f $(DOCS_DIR)/*.[0-9].gz $(DOCS_DIR)/*.man.xml $(DOCS_DIR)/*.erl $(USAGES_ERL)
rm -f $(RABBIT_PLT)
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl
index 1163ae9d86..b28748538e 100644
--- a/src/rabbit_control.erl
+++ b/src/rabbit_control.erl
@@ -86,24 +86,24 @@ start() ->
true -> ok;
false -> io:format("...done.~n")
end,
- quit(0);
+ rabbit_misc:quit(0);
{'EXIT', {function_clause, [{?MODULE, action, _} | _]}} ->
print_error("invalid command '~s'",
[string:join([atom_to_list(Command) | Args], " ")]),
usage();
{error, Reason} ->
print_error("~p", [Reason]),
- quit(2);
+ rabbit_misc:quit(2);
{badrpc, {'EXIT', Reason}} ->
print_error("~p", [Reason]),
- quit(2);
+ rabbit_misc:quit(2);
{badrpc, Reason} ->
print_error("unable to connect to node ~w: ~w", [Node, Reason]),
print_badrpc_diagnostics(Node),
- quit(2);
+ rabbit_misc:quit(2);
Other ->
print_error("~p", [Other]),
- quit(2)
+ rabbit_misc:quit(2)
end.
fmt_stderr(Format, Args) -> rabbit_misc:format_stderr(Format ++ "~n", Args).
@@ -154,7 +154,7 @@ stop() ->
usage() ->
io:format("~s", [rabbit_ctl_usage:usage()]),
- quit(1).
+ rabbit_misc:quit(1).
%%----------------------------------------------------------------------------
@@ -506,10 +506,3 @@ prettify_typed_amqp_value(table, Value) -> prettify_amqp_table(Value);
prettify_typed_amqp_value(array, Value) -> [prettify_typed_amqp_value(T, V) ||
{T, V} <- Value];
prettify_typed_amqp_value(_Type, Value) -> Value.
-
-%% the slower shutdown on windows required to flush stdout
-quit(Status) ->
- case os:type() of
- {unix, _} -> halt(Status);
- {win32, _} -> init:stop(Status)
- end.
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl
index ae28722ab2..0b72443fa5 100644
--- a/src/rabbit_misc.erl
+++ b/src/rabbit_misc.erl
@@ -59,6 +59,7 @@
-export([pget/2, pget/3, pget_or_die/2]).
-export([format_message_queue/2]).
-export([append_rpc_all_nodes/4]).
+-export([quit/1]).
%%----------------------------------------------------------------------------
@@ -210,6 +211,7 @@
-spec(pget_or_die/2 :: (term(), [term()]) -> term() | no_return()).
-spec(format_message_queue/2 :: (any(), priority_queue:q()) -> term()).
-spec(append_rpc_all_nodes/4 :: ([node()], atom(), atom(), [any()]) -> [any()]).
+-spec(quit/1 :: (integer() | string()) -> no_return()).
-endif.
@@ -963,3 +965,10 @@ append_rpc_all_nodes(Nodes, M, F, A) ->
{badrpc, _} -> [];
_ -> Res
end || Res <- ResL]).
+
+%% the slower shutdown on windows required to flush stdout
+quit(Status) ->
+ case os:type() of
+ {unix, _} -> halt(Status);
+ {win32, _} -> init:stop(Status)
+ end.
diff --git a/src/rabbit_plugin.erl b/src/rabbit_plugin.erl
index 4987dc5952..6d94cee73a 100644
--- a/src/rabbit_plugin.erl
+++ b/src/rabbit_plugin.erl
@@ -33,16 +33,9 @@
start() ->
io:format("Rabbitmq-plugin, GO!~n"),
- quit(0).
+ rabbit_misc:quit(0).
stop() ->
ok.
%%----------------------------------------------------------------------------
-
-%% the slower shutdown on windows required to flush stdout
-quit(Status) ->
- case os:type() of
- {unix, _} -> halt(Status);
- {win32, _} -> init:stop(Status)
- end.