aboutsummaryrefslogtreecommitdiffstats
path: root/lib/percept/src/percept.erl
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2016-05-16 18:39:31 +0200
committerBjörn-Egil Dahlberg <[email protected]>2016-05-17 13:46:04 +0200
commita4217eeeda0092b66970edda7b585eb4c4796700 (patch)
tree165b8a5270564528540b4112bcbbcc1818d4e2d5 /lib/percept/src/percept.erl
parentf2924fe206b37766cc137f8dbeca746a035abfdb (diff)
downloadotp-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.erl11
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.