aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2017-06-26 09:08:46 +0200
committerHans Bolinder <[email protected]>2017-06-26 09:08:46 +0200
commit900ef806aed51dd9b976e14cde63e3282a39b685 (patch)
treeefaa7ae9cbdd3ef4341dff857457da0d5db54d54
parent742b316a05f7b750bec8be6b8540d3ef3ddc6deb (diff)
parentbd2752e3d2ec91572e4d0c2fb35951f8f6bdc9f6 (diff)
downloadotp-900ef806aed51dd9b976e14cde63e3282a39b685.tar.gz
otp-900ef806aed51dd9b976e14cde63e3282a39b685.tar.bz2
otp-900ef806aed51dd9b976e14cde63e3282a39b685.zip
Merge branch 'maint'
* maint: syntax_tools: erl_tidy: Do not hang when exits are trapped
-rw-r--r--lib/syntax_tools/src/erl_tidy.erl2
-rw-r--r--lib/syntax_tools/test/syntax_tools_SUITE.erl6
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/syntax_tools/src/erl_tidy.erl b/lib/syntax_tools/src/erl_tidy.erl
index 1ca60ea73b..888cb71f51 100644
--- a/lib/syntax_tools/src/erl_tidy.erl
+++ b/lib/syntax_tools/src/erl_tidy.erl
@@ -301,6 +301,8 @@ file(Name, Opts) ->
{Child, ok} ->
ok;
{Child, {error, Reason}} ->
+ exit(Reason);
+ {'EXIT', Child, Reason} ->
exit(Reason)
end.
diff --git a/lib/syntax_tools/test/syntax_tools_SUITE.erl b/lib/syntax_tools/test/syntax_tools_SUITE.erl
index 868f43b8ee..ae2c67c03e 100644
--- a/lib/syntax_tools/test/syntax_tools_SUITE.erl
+++ b/lib/syntax_tools/test/syntax_tools_SUITE.erl
@@ -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;