diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2012-08-08 15:49:08 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2012-08-08 15:49:08 +0100 |
| commit | cd0fb668c5579b7232dbaca0d0f2200dd0d56777 (patch) | |
| tree | 911a486fac34a12df1ba3e482a4466e596317c2e | |
| parent | fdeb9ce349f81cf8fcdc1bd9ca8e6e2f3f0b987b (diff) | |
| parent | 21bcf2bbd44573a0326b7b0141aa6cdd5e2eae89 (diff) | |
| download | rabbitmq-server-git-cd0fb668c5579b7232dbaca0d0f2200dd0d56777.tar.gz | |
Merge bug25087
| -rw-r--r-- | src/rabbit_misc.erl | 10 | ||||
| -rw-r--r-- | src/rabbit_plugins.erl | 18 |
2 files changed, 8 insertions, 20 deletions
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl index 5eb24327be..8f6a9bcf4e 100644 --- a/src/rabbit_misc.erl +++ b/src/rabbit_misc.erl @@ -19,7 +19,7 @@ -include("rabbit_framing.hrl"). -export([method_record_type/1, polite_pause/0, polite_pause/1]). --export([die/1, frame_error/2, amqp_error/4, quit/1, quit/2, +-export([die/1, frame_error/2, amqp_error/4, quit/1, protocol_error/3, protocol_error/4, protocol_error/1]). -export([not_found/1, assert_args_equivalence/4]). -export([dirty_read/1]). @@ -92,7 +92,6 @@ (rabbit_framing:amqp_exception()) -> channel_or_connection_exit()). -spec(quit/1 :: (integer()) -> no_return()). --spec(quit/2 :: (string(), [term()]) -> no_return()). -spec(frame_error/2 :: (rabbit_framing:amqp_method_name(), binary()) -> rabbit_types:connection_exit()). @@ -396,13 +395,6 @@ report_coverage_percentage(File, Cov, NotCov, Mod) -> confirm_to_sender(Pid, MsgSeqNos) -> gen_server2:cast(Pid, {confirm, MsgSeqNos, self()}). -%% @doc Halts the emulator after printing out an error message -%% io-formatted with the supplied arguments. The exit status of the -%% beam process will be set to 1. -quit(Fmt, Args) -> - io:format("ERROR: " ++ Fmt ++ "~n", Args), - quit(1). - %% @doc Halts the emulator returning the given status code to the os. %% On Windows this function will block indefinitely so as to give the io %% subsystem time to flush stdout completely. diff --git a/src/rabbit_plugins.erl b/src/rabbit_plugins.erl index c3d1ad7c61..0320c69fc2 100644 --- a/src/rabbit_plugins.erl +++ b/src/rabbit_plugins.erl @@ -51,8 +51,8 @@ setup() -> {ok, ExpandDir} = application:get_env(rabbit, plugins_expand_dir), {ok, EnabledFile} = application:get_env(rabbit, enabled_plugins_file), prepare_plugins(EnabledFile, PluginDir, ExpandDir), - [prepare_dir_plugin(PluginName) || - PluginName <- filelib:wildcard(ExpandDir ++ "/*/ebin/*.app")]. + [prepare_dir_plugin(PluginAppDescPath) || + PluginAppDescPath <- filelib:wildcard(ExpandDir ++ "/*/ebin/*.app")]. %% @doc Lists the plugins which are currently running. active() -> @@ -137,15 +137,11 @@ prepare_plugins(EnabledFile, PluginsDistDir, ExpandDir) -> [prepare_plugin(Plugin, ExpandDir) || Plugin <- ToUnpackPlugins]. -prepare_dir_plugin(PluginAppDescFn) -> - %% Add the plugin ebin directory to the load path - PluginEBinDirN = filename:dirname(PluginAppDescFn), - code:add_path(PluginEBinDirN), - - %% We want the second-last token - NameTokens = string:tokens(PluginAppDescFn,"/."), - PluginNameString = lists:nth(length(NameTokens) - 1, NameTokens), - list_to_atom(PluginNameString). +prepare_dir_plugin(PluginAppDescPath) -> + PluginEBinDir = filename:dirname(PluginAppDescPath), + code:add_path(PluginEBinDir), + NameTokens = string:tokens(PluginAppDescPath, "/."), + list_to_atom(lists:nth(length(NameTokens) - 1, NameTokens)). %%---------------------------------------------------------------------------- |
