diff options
author | Dan Gudmundsson <[email protected]> | 2016-11-08 09:51:40 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2016-11-08 09:51:40 +0100 |
commit | 2d78b8d501ba9c108c735212a985e96792b79999 (patch) | |
tree | 596509dda516dacd3d2bff5627120bb0ecf0eb5e /lib/mnesia/src/mnesia_sup.erl | |
parent | 0805ac891e3a048e0d7382dec84b8682ad9c6c9c (diff) | |
parent | cd8438832471e7444eec7b78cd1aaee6779cc28a (diff) | |
download | otp-2d78b8d501ba9c108c735212a985e96792b79999.tar.gz otp-2d78b8d501ba9c108c735212a985e96792b79999.tar.bz2 otp-2d78b8d501ba9c108c735212a985e96792b79999.zip |
Merge branch 'richcarl/mnesia-app-module/PR-1223'
* richcarl/mnesia-app-module/PR-1223:
Make a separate application module for Mnesia
Diffstat (limited to 'lib/mnesia/src/mnesia_sup.erl')
-rw-r--r-- | lib/mnesia/src/mnesia_sup.erl | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/lib/mnesia/src/mnesia_sup.erl b/lib/mnesia/src/mnesia_sup.erl index 4aece81308..3e5792900b 100644 --- a/lib/mnesia/src/mnesia_sup.erl +++ b/lib/mnesia/src/mnesia_sup.erl @@ -23,39 +23,21 @@ -module(mnesia_sup). --behaviour(application). -behaviour(supervisor). --export([start/0, start/2, init/1, stop/1, start_event/0, kill/0]). +-export([start_link/1, init/1, start_event/0, kill/0]). -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% application and suprvisor callback functions - -start(normal, Args) -> - SupName = {local,?MODULE}, - case supervisor:start_link(SupName, ?MODULE, [Args]) of - {ok, Pid} -> - {ok, Pid, {normal, Args}}; - Error -> - Error - end; -start(_, _) -> - {error, badarg}. - -start() -> - SupName = {local,?MODULE}, - supervisor:start_link(SupName, ?MODULE, []). +start_link(Args) -> + supervisor:start_link({local,?MODULE}, ?MODULE, [Args]). -stop(_StartArgs) -> - ok. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% supervisor callback functions -init([]) -> % Supervisor - init(); -init([[]]) -> % Application +init([[]]) -> init(); init(BadArg) -> {error, {badarg, BadArg}}. - + init() -> Flags = {one_for_all, 0, 3600}, % Should be rest_for_one policy @@ -124,4 +106,3 @@ ensure_dead(Name) -> timer:sleep(10), ensure_dead(Name) end. - |