mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 11:06:20 +00:00
Skip erlang:halt/1 workaround if >=R15B01
This commit is contained in:
parent
769160ac36
commit
3f14c1c092
1 changed files with 16 additions and 7 deletions
|
@ -293,14 +293,23 @@ deprecated(Old, New, When) ->
|
||||||
|
|
||||||
-spec delayed_halt(integer()) -> no_return().
|
-spec delayed_halt(integer()) -> no_return().
|
||||||
delayed_halt(Code) ->
|
delayed_halt(Code) ->
|
||||||
case os:type() of
|
%% Work around buffer flushing issue in erlang:halt if OTP older
|
||||||
{win32, nt} ->
|
%% than R15B01.
|
||||||
timer:sleep(100),
|
%% TODO: remove workaround once we require R15B01 or newer
|
||||||
|
%% R15B01 introduced erlang:halt/2
|
||||||
|
case erlang:is_builtin(erlang, halt, 2) of
|
||||||
|
true ->
|
||||||
halt(Code);
|
halt(Code);
|
||||||
_ ->
|
false ->
|
||||||
halt(Code),
|
case os:type() of
|
||||||
%% workaround to delay exit until all output is written
|
{win32, nt} ->
|
||||||
receive after infinity -> ok end
|
timer:sleep(100),
|
||||||
|
halt(Code);
|
||||||
|
_ ->
|
||||||
|
halt(Code),
|
||||||
|
%% workaround to delay exit until all output is written
|
||||||
|
receive after infinity -> ok end
|
||||||
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
%% ====================================================================
|
%% ====================================================================
|
||||||
|
|
Loading…
Reference in a new issue