diff options
| author | Emile Joubert <emile@rabbitmq.com> | 2010-11-24 11:56:46 +0000 |
|---|---|---|
| committer | Emile Joubert <emile@rabbitmq.com> | 2010-11-24 11:56:46 +0000 |
| commit | 14d115196876a5880dc69d16000c6e889c639ac5 (patch) | |
| tree | 5611f35b8c7123ed91e1301aebc04abd1b5273eb /src | |
| parent | 381b56556798419a309b3d4b9a693ad77a9e6ac4 (diff) | |
| download | rabbitmq-server-git-14d115196876a5880dc69d16000c6e889c639ac5.tar.gz | |
Slower rabbitmqctl shutdown on windows flushes output
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_control.erl | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl index 72b77b1f07..ae10712ed8 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. |
