diff options
author | Björn Gustavsson <[email protected]> | 2014-06-11 15:48:28 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2014-06-12 12:06:09 +0200 |
commit | 9eccead7d89673648318815716b73f6d50ec068b (patch) | |
tree | f00421ff1897703d499e7b812e98f532caea9862 | |
parent | 7274a9db9b17cc14fde15a3aa0574136c58e8551 (diff) | |
download | otp-9eccead7d89673648318815716b73f6d50ec068b.tar.gz otp-9eccead7d89673648318815716b73f6d50ec068b.tar.bz2 otp-9eccead7d89673648318815716b73f6d50ec068b.zip |
Allow unsticking pre-loaded modules
Commit ed06dd12ea74018b902a2c4c7924313d23cedb75 made pre-loaded
modules (such as erlang) sticky, and also made it impossible to
unstick them to prevent them from ever be reloaded.
It turns out that there are tools that may want to instrument
the erlang module (such as concuerror), so making it
impossible to unstick modules is harsh. Therefore, revert the
part of the commit that prevented unsticking the pre-loaded
modules.
-rw-r--r-- | lib/kernel/src/code_server.erl | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/kernel/src/code_server.erl b/lib/kernel/src/code_server.erl index dd06affd70..819554ce74 100644 --- a/lib/kernel/src/code_server.erl +++ b/lib/kernel/src/code_server.erl @@ -1168,7 +1168,7 @@ stick_dir(Dir, Stick, St) -> true -> foreach(fun (M) -> ets:insert(Db, {{sticky,M},true}) end, Mods); false -> - foreach(fun (M) -> do_unstick_mod(Db, M) end, Mods) + foreach(fun (M) -> ets:delete(Db, {sticky,M}) end, Mods) end; Error -> Error @@ -1180,15 +1180,6 @@ stick_mod(M, Stick, St) -> true -> ets:insert(Db, {{sticky,M},true}); false -> - do_unstick_mod(Db, M) - end. - -do_unstick_mod(Db, M) -> - case ets:lookup(Db, M) of - [{M,preloaded}] -> - %% Never unstick pre-loaded modules. - true; - _ -> ets:delete(Db, {sticky,M}) end. |