diff options
author | Brian Cully <bjc@kublai.com> | 2012-02-09 15:03:28 -0500 |
---|---|---|
committer | Brian Cully <bjc@kublai.com> | 2012-02-09 15:03:28 -0500 |
commit | 44d5b82c5d48a3b8eb58642ccc882357392c7274 (patch) | |
tree | 9653668b9929b76af60047b529fdd195abeb3f95 | |
parent | b6d09140c407f5642984abecf213ba830c33f917 (diff) | |
download | mysqlerl-44d5b82c5d48a3b8eb58642ccc882357392c7274.tar.gz mysqlerl-44d5b82c5d48a3b8eb58642ccc882357392c7274.zip |
Move start_link out of port_sup
-rw-r--r-- | src/mysqlerl_connection.erl | 5 | ||||
-rw-r--r-- | src/mysqlerl_port_sup.erl | 5 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/mysqlerl_connection.erl b/src/mysqlerl_connection.erl index 362b807..e009428 100644 --- a/src/mysqlerl_connection.erl +++ b/src/mysqlerl_connection.erl @@ -26,8 +26,9 @@ stop(Pid) -> init([Owner, Host, Port, Database, User, Password, Options]) -> process_flag(trap_exit, true), link(Owner), - {ok, Sup} = mysqlerl_port_sup:start_link(helper(), Host, Port, Database, - User, Password, Options), + {ok, Sup} = supervisor:start_link(mysqlerl_port_sup, + [helper(), Host, Port, Database, + User, Password, Options]), {ok, #state{sup = Sup, owner = Owner}}. terminate(Reason, _State) -> diff --git a/src/mysqlerl_port_sup.erl b/src/mysqlerl_port_sup.erl index 3053cdc..f215d48 100644 --- a/src/mysqlerl_port_sup.erl +++ b/src/mysqlerl_port_sup.erl @@ -3,13 +3,8 @@ -behavior(supervisor). --export([start_link/7]). -export([init/1]). -start_link(Cmd, Host, Port, Database, User, Password, Options) -> - supervisor:start_link(?MODULE, [Cmd, Host, Port, Database, - User, Password, Options]). - init([Cmd, Host, Port, Database, User, Password, Options]) -> Ref = {mysqlerl_port, {mysqlerl_port, start_link, [Cmd, Host, Port, Database, |