diff options
author | Björn-Egil Dahlberg <[email protected]> | 2016-05-13 13:28:49 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2016-05-13 13:28:49 +0200 |
commit | bab87d0bf1dc89953caec354648c6c8db8737e92 (patch) | |
tree | 6d7479763672b8e4a7177bb04dec0f1eb123a6a0 /lib/runtime_tools/src/system_information.erl | |
parent | 9addbee447442a08430557c20d24c961df224926 (diff) | |
parent | 5f312eab94a4477a36637f9594ae6da9b8b2a6aa (diff) | |
download | otp-bab87d0bf1dc89953caec354648c6c8db8737e92.tar.gz otp-bab87d0bf1dc89953caec354648c6c8db8737e92.tar.bz2 otp-bab87d0bf1dc89953caec354648c6c8db8737e92.zip |
Merge branch 'egil/runtime_tools/fix-unmatched_return/OTP-13595'
* egil/runtime_tools/fix-unmatched_return/OTP-13595:
runtime_tools: Fix unmatched return warnings
Diffstat (limited to 'lib/runtime_tools/src/system_information.erl')
-rw-r--r-- | lib/runtime_tools/src/system_information.erl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/runtime_tools/src/system_information.erl b/lib/runtime_tools/src/system_information.erl index 1add01612d..df25297eb9 100644 --- a/lib/runtime_tools/src/system_information.erl +++ b/lib/runtime_tools/src/system_information.erl @@ -31,6 +31,7 @@ -export([report/0, from_file/1, to_file/1]). + -export([start/0, stop/0, load_report/0, load_report/2, applications/0, applications/1, @@ -64,6 +65,7 @@ start() -> gen_server:start({local, ?SERVER}, ?MODULE, [], []). + stop() -> gen_server:call(?SERVER, stop, infinity). @@ -71,7 +73,7 @@ load_report() -> load_report(data, report()). load_report(file, File) -> load_report(data, from_file(File)); load_report(data, Report) -> - start(), gen_server:call(?SERVER, {load_report, Report}, infinity). + ok = start_internal(), gen_server:call(?SERVER, {load_report, Report}, infinity). report() -> [ {init_arguments, init:get_arguments()}, @@ -219,6 +221,13 @@ code_change(_OldVsn, State, _Extra) -> %% Internal functions %%=================================================================== +start_internal() -> + case start() of + {ok,_} -> ok; + {error, {already_started,_}} -> ok; + Error -> Error + end. + %% handle report values get_value([], Data) -> Data; |