diff options
author | Håkan Mattsson <[email protected]> | 2010-04-01 13:09:35 +0200 |
---|---|---|
committer | Håkan Mattsson <[email protected]> | 2010-04-19 13:17:33 +0200 |
commit | 2f304e221f790af9b0bf15d9ea8f8f447159351e (patch) | |
tree | dbfa42e77e516021a814e79344d5f88bc5b4c9e2 /lib/reltool/src/reltool_utils.erl | |
parent | 21db0d0e7e7112d7c257ed19fc8e3c0a90d4698b (diff) | |
download | otp-2f304e221f790af9b0bf15d9ea8f8f447159351e.tar.gz otp-2f304e221f790af9b0bf15d9ea8f8f447159351e.tar.bz2 otp-2f304e221f790af9b0bf15d9ea8f8f447159351e.zip |
Ensure that {error, Reason} is returned even when server dies
Diffstat (limited to 'lib/reltool/src/reltool_utils.erl')
-rw-r--r-- | lib/reltool/src/reltool_utils.erl | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/lib/reltool/src/reltool_utils.erl b/lib/reltool/src/reltool_utils.erl index b33820c568..39d057d994 100644 --- a/lib/reltool/src/reltool_utils.erl +++ b/lib/reltool/src/reltool_utils.erl @@ -20,7 +20,8 @@ %% Public -export([root_dir/0, erl_libs/0, lib_dirs/1, - split_app_name/1, prim_consult/1, default_rels/0, + split_app_name/1, prim_consult/1, + default_rels/0, choose_default/3, assign_image_list/1, get_latest_resize/1, mod_conds/0, list_to_mod_cond/1, mod_cond_to_index/1, @@ -139,6 +140,32 @@ default_rels() -> %%rel_apps = [Kernel, Sasl, Stdlib]} ]. +choose_default(Tag, Profile, InclDefs) + when Profile =:= ?DEFAULT_PROFILE; InclDefs -> + case Tag of + incl_sys_filters -> ?DEFAULT_INCL_SYS_FILTERS; + excl_sys_filters -> ?DEFAULT_EXCL_SYS_FILTERS; + incl_app_filters -> ?DEFAULT_INCL_APP_FILTERS; + excl_app_filters -> ?DEFAULT_EXCL_APP_FILTERS; + embedded_app_type -> ?DEFAULT_EMBEDDED_APP_TYPE + end; +choose_default(Tag, standalone, _InclDefs) -> + case Tag of + incl_sys_filters -> ?STANDALONE_INCL_SYS_FILTERS; + excl_sys_filters -> ?STANDALONE_EXCL_SYS_FILTERS; + incl_app_filters -> ?STANDALONE_INCL_APP_FILTERS; + excl_app_filters -> ?STANDALONE_EXCL_APP_FILTERS; + embedded_app_type -> ?DEFAULT_EMBEDDED_APP_TYPE + end; +choose_default(Tag, embedded, _InclDefs) -> + case Tag of + incl_sys_filters -> ?EMBEDDED_INCL_SYS_FILTERS; + excl_sys_filters -> ?EMBEDDED_EXCL_SYS_FILTERS; + incl_app_filters -> ?EMBEDDED_INCL_APP_FILTERS; + excl_app_filters -> ?EMBEDDED_EXCL_APP_FILTERS; + embedded_app_type -> ?EMBEDDED_APP_TYPE + end. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% assign_image_list(ListCtrl) -> @@ -584,7 +611,12 @@ escript_foldl(Fun, Acc, File) -> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% call(Name, Msg) when is_atom(Name) -> - call(whereis(Name), Msg); + case whereis(Name) of + undefined -> + {error, {noproc, Name}}; + Pid -> + call(Pid, Msg) + end; call(Pid, Msg) when is_pid(Pid) -> Ref = erlang:monitor(process, Pid), Pid ! {call, self(), Ref, Msg}, |