aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reltool/bin/reltool.escript
diff options
context:
space:
mode:
authorHåkan Mattsson <[email protected]>2010-03-23 16:50:50 +0100
committerHåkan Mattsson <[email protected]>2010-04-19 13:17:33 +0200
commit534f334247163035b477293e74b78823f2d9b7f3 (patch)
tree10fba9717bb98da3212ee630ad4e63dd9fa60b86 /lib/reltool/bin/reltool.escript
parent5217fb3d0816aa241d228f7ef14fb54f6a14a8f8 (diff)
downloadotp-534f334247163035b477293e74b78823f2d9b7f3.tar.gz
otp-534f334247163035b477293e74b78823f2d9b7f3.tar.bz2
otp-534f334247163035b477293e74b78823f2d9b7f3.zip
Automatically include applications that must be started
Applications that are required to be started before other applications according to their app-file are now automatically included in the release. The kernel and stdlib applications are automatically included.
Diffstat (limited to 'lib/reltool/bin/reltool.escript')
-rw-r--r--lib/reltool/bin/reltool.escript10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/reltool/bin/reltool.escript b/lib/reltool/bin/reltool.escript
index 567cafbcad..1e5f34d99d 100644
--- a/lib/reltool/bin/reltool.escript
+++ b/lib/reltool/bin/reltool.escript
@@ -27,14 +27,14 @@ main(Args) ->
{Options, Actions} = parse_args(Tokens, []),
case invoke(Options, Actions) of
ok ->
- erlang:halt(0);
+ safe_stop(0);
{error, ReasonString} ->
fatal_error(ReasonString, 2)
end
catch
throw:usage ->
usage(),
- erlang:halt(1);
+ safe_stop(1);
exit:Reason ->
String = lists:flatten(io_lib:format("EXIT: ~p", [Reason])),
fatal_error(String, 3)
@@ -59,6 +59,10 @@ usage() ->
"See User's guide and Reference manual for more info.\n",
[String]).
+safe_stop(Code) ->
+ init:stop(Code),
+ timer:sleep(infinity).
+
invoke(Options, Actions) ->
case Actions of
[] ->
@@ -174,7 +178,7 @@ script_name() ->
fatal_error(String, Code) ->
io:format(standard_error, "~s: ~s\n", [script_name(), String]),
- erlang:halt(Code).
+ safe_stop(Code).
write_file(File, IoList) ->
case file:write_file(File, IoList) of