diff options
author | Björn-Egil Dahlberg <[email protected]> | 2016-05-16 18:39:31 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2016-05-17 13:46:04 +0200 |
commit | a4217eeeda0092b66970edda7b585eb4c4796700 (patch) | |
tree | 165b8a5270564528540b4112bcbbcc1818d4e2d5 /lib/percept/src/percept.erl | |
parent | f2924fe206b37766cc137f8dbeca746a035abfdb (diff) | |
download | otp-a4217eeeda0092b66970edda7b585eb4c4796700.tar.gz otp-a4217eeeda0092b66970edda7b585eb4c4796700.tar.bz2 otp-a4217eeeda0092b66970edda7b585eb4c4796700.zip |
percept: Fix unmatched return warnings
Diffstat (limited to 'lib/percept/src/percept.erl')
-rw-r--r-- | lib/percept/src/percept.erl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/percept/src/percept.erl b/lib/percept/src/percept.erl index d53be5f9e2..046e0b7518 100644 --- a/lib/percept/src/percept.erl +++ b/lib/percept/src/percept.erl @@ -151,11 +151,11 @@ start_webserver() -> {'started', string(), pos_integer()} | {'error', any()}. start_webserver(Port) when is_integer(Port) -> - application:load(percept), + ok = ensure_loaded(percept), case whereis(percept_httpd) of undefined -> {ok, Config} = get_webserver_config("percept", Port), - inets:start(), + ok = application:ensure_started(inets), case inets:start(httpd, Config) of {ok, Pid} -> AssignedPort = find_service_port_from_pid(inets:services_info(), Pid), @@ -328,3 +328,10 @@ get_webserver_config(Servername, Port) when is_list(Servername), is_integer(Port {bind_address, any}, {port, Port}], {ok, Config}. + +ensure_loaded(App) -> + case application:load(App) of + ok -> ok; + {error,{already_loaded,App}} -> ok; + Error -> Error + end. |