From 534f334247163035b477293e74b78823f2d9b7f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kan=20Mattsson?= Date: Tue, 23 Mar 2010 16:50:50 +0100 Subject: 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. --- lib/reltool/bin/reltool.escript | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/reltool/bin/reltool.escript') 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 -- cgit v1.2.3