diff options
author | Björn Gustavsson <[email protected]> | 2012-08-08 10:37:27 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-08-08 10:37:27 +0200 |
commit | 509d798a2f4e70fe3c0d467903481ae3c3d612a9 (patch) | |
tree | a5a0f27ac4dc192ae0c09f6601bf7f7d82570ea6 /lib/compiler/src/compile.erl | |
parent | c552578844dd616bb49727e53df02f0aab5f3719 (diff) | |
parent | c595aff5bd41a5d392145212606c87e40779e142 (diff) | |
download | otp-509d798a2f4e70fe3c0d467903481ae3c3d612a9.tar.gz otp-509d798a2f4e70fe3c0d467903481ae3c3d612a9.tar.bz2 otp-509d798a2f4e70fe3c0d467903481ae3c3d612a9.zip |
Merge branch 'maint'
* maint:
compiler: Eliminate EXIT messages from the temporary compiler process
Diffstat (limited to 'lib/compiler/src/compile.erl')
-rw-r--r-- | lib/compiler/src/compile.erl | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl index 7911f51a73..7365706b94 100644 --- a/lib/compiler/src/compile.erl +++ b/lib/compiler/src/compile.erl @@ -146,10 +146,17 @@ env_default_opts() -> do_compile(Input, Opts0) -> Opts = expand_opts(Opts0), - Self = self(), - Serv = spawn_link(fun() -> internal(Self, Input, Opts) end), + {Pid,Ref} = + spawn_monitor(fun() -> + exit(try + internal(Input, Opts) + catch + error:Reason -> + {error,Reason} + end) + end), receive - {Serv,Rep} -> Rep + {'DOWN',Ref,process,Pid,Rep} -> Rep end. expand_opts(Opts0) -> @@ -242,11 +249,6 @@ format_error({module_name,Mod,Filename}) -> errors=[], warnings=[]}). -internal(Master, Input, Opts) -> - Master ! {self(), try internal(Input, Opts) - catch error:Reason -> {error, Reason} - end}. - internal({forms,Forms}, Opts0) -> {_,Ps} = passes(forms, Opts0), Source = proplists:get_value(source, Opts0, ""), |