Skip to content

Commit 5942933

Browse files
committed
Minor corrections
1 parent 4753534 commit 5942933

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

src/erlang_doctor_sup.erl

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,21 @@
1515

1616
-define(SERVER, ?MODULE).
1717

18-
%%====================================================================
1918
%% API functions
20-
%%====================================================================
2119

2220
start_link() ->
2321
supervisor:start_link({local, ?SERVER}, ?MODULE, []).
2422

25-
%%====================================================================
2623
%% Supervisor callbacks
27-
%%====================================================================
2824

29-
%% Child :: {Id,StartFunc,Restart,Shutdown,Type,Modules}
25+
-spec init([]) -> {ok, {supervisor:sup_flags(), [supervisor:child_spec()]}}.
3026
init([]) ->
31-
{ok, { {one_for_all, 0, 1},
32-
[tr_spec()]}
33-
}.
27+
{ok, {#{}, [tr_spec()]}}.
3428

35-
%%====================================================================
3629
%% Internal functions
37-
%%====================================================================
3830

31+
-spec tr_spec() -> supervisor:child_spec().
3932
tr_spec() ->
40-
{tr,
41-
{tr, start_link, []},
42-
permanent,
43-
brutal_kill,
44-
worker,
45-
[tr]}.
33+
#{id => tr,
34+
start => {tr, start_link, []},
35+
shutdown => brutal_kill}.

src/tr.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ tab() ->
291291

292292
%% @doc Sets a new ETS table for collecting traces, creating it if it doesn't exist.
293293
-spec set_tab(table()) -> ok.
294-
set_tab(Tab) ->
294+
set_tab(Tab) when is_atom(Tab) ->
295295
gen_server:call(?MODULE, {set_tab, Tab}).
296296

297297
%% @doc Loads an ETS trace table from a file, and makes it the current table.

0 commit comments

Comments
 (0)