Permalink
Browse files

Merge branch 'maint'

* maint:
  syntax_tools: erl_tidy: Do not hang when exits are trapped
  • Loading branch information...
2 parents 742b316 + bd2752e commit 900ef806aed51dd9b976e14cde63e3282a39b685 @uabboli uabboli committed Jun 26, 2017
Showing with 8 additions and 0 deletions.
  1. +2 −0 lib/syntax_tools/src/erl_tidy.erl
  2. +6 −0 lib/syntax_tools/test/syntax_tools_SUITE.erl
@@ -301,6 +301,8 @@ file(Name, Opts) ->
{Child, ok} ->
ok;
{Child, {error, Reason}} ->
+ exit(Reason);
+ {'EXIT', Child, Reason} ->
exit(Reason)
end.
@@ -239,6 +239,12 @@ t_erl_tidy(Config) when is_list(Config) ->
DataDir = ?config(data_dir, Config),
File = filename:join(DataDir,"erl_tidy_tilde.erl"),
ok = erl_tidy:file(File, [{stdout, true}]),
+
+ %% OTP-14471.
+ Old = process_flag(trap_exit, true),
+ NonExisting = filename:join(DataDir,"non_existing_file.erl"),
+ {'EXIT',{error,{0,file,enoent}}} = (catch erl_tidy:file(NonExisting)),
+ true = process_flag(trap_exit, Old),
ok.
test_comment_scan([],_) -> ok;

0 comments on commit 900ef80

Please sign in to comment.