aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded/src
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-12-16 20:03:32 +0100
committerSverker Eriksson <[email protected]>2016-01-13 19:59:54 +0100
commit79efde2d8503e5055ef9e8afa5d8d63208710b1f (patch)
tree77342e16ab227d8b9a175f4573305f244d17cceb /erts/preloaded/src
parentdc54c2a27c41930a18e0c7f2b97eda6cd4a0b1c1 (diff)
downloadotp-79efde2d8503e5055ef9e8afa5d8d63208710b1f.tar.gz
otp-79efde2d8503e5055ef9e8afa5d8d63208710b1f.tar.bz2
otp-79efde2d8503e5055ef9e8afa5d8d63208710b1f.zip
erts: Make copy_literals more fail safe
* Same process must do enable-disable. * System process will force it and never get 'aborted'
Diffstat (limited to 'erts/preloaded/src')
-rw-r--r--erts/preloaded/src/erts_code_purger.erl12
1 files changed, 5 insertions, 7 deletions
diff --git a/erts/preloaded/src/erts_code_purger.erl b/erts/preloaded/src/erts_code_purger.erl
index c7fe3ce22f..791ef72f13 100644
--- a/erts/preloaded/src/erts_code_purger.erl
+++ b/erts/preloaded/src/erts_code_purger.erl
@@ -63,11 +63,10 @@ purge(Mod) when is_atom(Mod) ->
do_purge(Mod) ->
- case erlang:check_old_code(Mod) of
+ case erts_internal:copy_literals(Mod, true) of
false ->
{false, false};
true ->
- true = erts_internal:copy_literals(Mod, true),
DidKill = check_proc_code(erlang:processes(), Mod, true),
true = erts_internal:copy_literals(Mod, false),
WasPurged = erts_internal:purge_module(Mod),
@@ -89,17 +88,16 @@ soft_purge(Mod) ->
do_soft_purge(Mod) ->
- case erlang:check_old_code(Mod) of
+ case erts_internal:copy_literals(Mod, true) of
false ->
true;
true ->
- true = erts_internal:copy_literals(Mod, true),
- case check_proc_code(erlang:processes(), Mod, false) of
+ DoPurge = check_proc_code(erlang:processes(), Mod, false),
+ true = erts_internal:copy_literals(Mod, false),
+ case DoPurge of
false ->
- true = erts_internal:copy_literals(Mod, false),
false;
true ->
- true = erts_internal:copy_literals(Mod, false),
erts_internal:purge_module(Mod),
true
end