summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmile Joubert <emile@rabbitmq.com>2010-11-24 11:56:46 +0000
committerEmile Joubert <emile@rabbitmq.com>2010-11-24 11:56:46 +0000
commit99199ea02573ce25d1f058eef75f4919eb7ddb4d (patch)
tree5611f35b8c7123ed91e1301aebc04abd1b5273eb
parentfced7c44a84af0a37298c575cf8430af23444085 (diff)
downloadrabbitmq-server-99199ea02573ce25d1f058eef75f4919eb7ddb4d.tar.gz
Slower rabbitmqctl shutdown on windows flushes output
-rw-r--r--src/rabbit_control.erl20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl
index 72b77b1f..ae10712e 100644
--- a/src/rabbit_control.erl
+++ b/src/rabbit_control.erl
@@ -91,24 +91,24 @@ start() ->
true -> ok;
false -> io:format("...done.~n")
end,
- halt();
+ 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]),
- halt(2);
+ quit(2);
{badrpc, {'EXIT', Reason}} ->
print_error("~p", [Reason]),
- halt(2);
+ quit(2);
{badrpc, Reason} ->
print_error("unable to connect to node ~w: ~w", [Node, Reason]),
print_badrpc_diagnostics(Node),
- halt(2);
+ quit(2);
Other ->
print_error("~p", [Other]),
- halt(2)
+ quit(2)
end.
fmt_stderr(Format, Args) -> rabbit_misc:format_stderr(Format ++ "~n", Args).
@@ -140,7 +140,7 @@ stop() ->
usage() ->
io:format("~s", [rabbit_ctl_usage:usage()]),
- halt(1).
+ quit(1).
action(stop, Node, [], _Opts, Inform) ->
Inform("Stopping and halting node ~p", [Node]),
@@ -395,3 +395,11 @@ prettify_typed_amqp_value(Type, Value) ->
array -> [prettify_typed_amqp_value(T, V) || {T, V} <- Value];
_ -> Value
end.
+
+quit(Status) ->
+ case os:type() of
+ {unix, _} ->
+ halt(Status);
+ {win32, _} ->
+ init:stop(Status)
+ end.