From 613d38e288c0e848dc6616fc59a5a2ed69dac165 Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Mon, 4 May 2015 23:25:17 +0800 Subject: [PATCH] dialyzer --- Makefile | 15 +++++++++++++++ apps/emqttd/src/emqttd_bridge_sup.erl | 2 +- apps/emqttd/src/emqttd_event.erl | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3babaec69..a3b509386 100644 --- a/Makefile +++ b/Makefile @@ -38,3 +38,18 @@ plugins: dist: rel plugins +PLT = $(BASE_DIR)/.emqttd_dialyzer.plt +APPS = erts kernel stdlib sasl crypto ssl os_mon syntax_tools \ + public_key mnesia inets compiler + +check_plt: compile + dialyzer --check_plt --plt $(PLT) --apps $(APPS) \ + deps/*/ebin apps/*/ebin + +build_plt: compile + dialyzer --build_plt --output_plt $(PLT) --apps $(APPS) \ + deps/*/ebin apps/*/ebin + +dialyzer: compile + dialyzer -Wno_return --plt $(PLT) deps/*/ebin apps/*/ebin + diff --git a/apps/emqttd/src/emqttd_bridge_sup.erl b/apps/emqttd/src/emqttd_bridge_sup.erl index 5adda423a..93787937d 100644 --- a/apps/emqttd/src/emqttd_bridge_sup.erl +++ b/apps/emqttd/src/emqttd_bridge_sup.erl @@ -74,7 +74,7 @@ start_bridge(Node, SubTopic, Options) when is_atom(Node) and is_binary(SubTopic) -spec stop_bridge(atom(), binary()) -> {ok, pid()} | ok. stop_bridge(Node, SubTopic) -> ChildId = bridge_id(Node, SubTopic), - case supervisor:terminate_child(ChildId) of + case supervisor:terminate_child(?MODULE, ChildId) of ok -> supervisor:delete_child(?MODULE, ChildId); {error, Reason} -> diff --git a/apps/emqttd/src/emqttd_event.erl b/apps/emqttd/src/emqttd_event.erl index 4fa57ac56..3db7817aa 100644 --- a/apps/emqttd/src/emqttd_event.erl +++ b/apps/emqttd/src/emqttd_event.erl @@ -114,5 +114,5 @@ payload(connected, Params) -> iolist_to_binary(io_lib:format("from: ~s~nprotocol: ~p~nsession: ~s", [From, Proto, Sess])); payload(disconnected, Reason) -> - list_to_binary(io_lib:format(["reason: ~p", Reason])). + list_to_binary(io_lib:format("reason: ~p", [Reason])).