diff options
author | Björn-Egil Dahlberg <[email protected]> | 2016-05-10 19:17:53 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2016-05-10 19:52:12 +0200 |
commit | ead64d5d32d4ba42193a49066c5f49475d89e410 (patch) | |
tree | a2e2349e178ebee21918a32c81260ef9988c3068 /lib/tools | |
parent | a745b4e8516b01fd202bffd8760fcf2d2aa778d6 (diff) | |
download | otp-ead64d5d32d4ba42193a49066c5f49475d89e410.tar.gz otp-ead64d5d32d4ba42193a49066c5f49475d89e410.tar.bz2 otp-ead64d5d32d4ba42193a49066c5f49475d89e410.zip |
eprof: Fix unmatched return warnings
Diffstat (limited to 'lib/tools')
-rw-r--r-- | lib/tools/src/eprof.erl | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/tools/src/eprof.erl b/lib/tools/src/eprof.erl index 07e995993b..3ae899a078 100644 --- a/lib/tools/src/eprof.erl +++ b/lib/tools/src/eprof.erl @@ -74,7 +74,6 @@ start() -> gen_server:start({local, ?MODULE}, ?MODULE, [], []). stop() -> gen_server:call(?MODULE, stop, infinity). - analyze() -> analyze(procs). @@ -112,7 +111,7 @@ profile(Rootset, M, F, A, Pattern) when is_list(Rootset), is_atom(M), is_atom(F) %% Returns when M:F/A has terminated profile(Rootset, M, F, A, Pattern, Options) -> - start(), + ok = start_internal(), gen_server:call(?MODULE, {profile_start, Rootset, Pattern, {M,F,A}, Options}, infinity). dump() -> @@ -127,7 +126,7 @@ start_profiling(Rootset) -> start_profiling(Rootset, Pattern) -> start_profiling(Rootset, Pattern, ?default_options). start_profiling(Rootset, Pattern, Options) -> - start(), + ok = start_internal(), gen_server:call(?MODULE, {profile_start, Rootset, Pattern, undefined, Options}, infinity). stop_profiling() -> @@ -251,9 +250,9 @@ handle_call({logfile, File}, _From, #state{ fd = OldFd } = S) -> {ok, Fd} -> case OldFd of undefined -> ok; - OldFd -> file:close(OldFd) + OldFd -> ok = file:close(OldFd) end, - {reply, ok, S#state{ fd = Fd}}; + {reply, ok, S#state{fd = Fd}}; Error -> {reply, Error, S} end; @@ -521,3 +520,10 @@ format(Fd, Format, Strings) -> divide(_,0) -> 0.0; divide(T,N) -> T/N. + +start_internal() -> + case start() of + {ok, _} -> ok; + {error, {already_started,_}} -> ok; + Error -> Error + end. |