summaryrefslogtreecommitdiff
path: root/lib/snmp/src/app/snmp_app_sup.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/snmp/src/app/snmp_app_sup.erl')
-rw-r--r--lib/snmp/src/app/snmp_app_sup.erl16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/snmp/src/app/snmp_app_sup.erl b/lib/snmp/src/app/snmp_app_sup.erl
index eb89cc5b6d..bb6faa18cb 100644
--- a/lib/snmp/src/app/snmp_app_sup.erl
+++ b/lib/snmp/src/app/snmp_app_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2023. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -64,7 +64,12 @@ start_agent(Type, Opts) ->
"~n Type: ~p"
"~n Opts: ~p", [Type, Opts]),
Restart = get_restart(Opts, permanent),
- start_sup_child(snmpa_supervisor, Restart, [Type, Opts]).
+ case start_sup_child(snmpa_supervisor, Restart, [Type, Opts]) of
+ {ok, Pid} = OK when is_pid(Pid) ->
+ OK;
+ {error, {Reason, _ChildSpec}} ->
+ {error, Reason}
+ end.
start_manager(Type, Opts) ->
@@ -72,7 +77,12 @@ start_manager(Type, Opts) ->
"~n Type: ~p"
"~n Opts: ~p", [Type, Opts]),
Restart = get_restart(Opts, transient),
- start_sup_child(snmpm_supervisor, Restart, [Type, Opts]).
+ case start_sup_child(snmpm_supervisor, Restart, [Type, Opts]) of
+ {ok, Pid} = OK when is_pid(Pid) ->
+ OK;
+ {error, {Reason, _ChildSpec}} ->
+ {error, Reason}
+ end.
%%%-------------------------------------------------------------------