aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2012-02-09 15:03:28 -0500
committerBrian Cully <bjc@kublai.com>2012-02-09 15:03:28 -0500
commit44d5b82c5d48a3b8eb58642ccc882357392c7274 (patch)
tree9653668b9929b76af60047b529fdd195abeb3f95
parentb6d09140c407f5642984abecf213ba830c33f917 (diff)
downloadmysqlerl-44d5b82c5d48a3b8eb58642ccc882357392c7274.tar.gz
mysqlerl-44d5b82c5d48a3b8eb58642ccc882357392c7274.zip
Move start_link out of port_sup
-rw-r--r--src/mysqlerl_connection.erl5
-rw-r--r--src/mysqlerl_port_sup.erl5
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,