aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/code_server.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-01-25 14:40:42 +0100
committerBjörn Gustavsson <[email protected]>2012-01-25 14:40:42 +0100
commit25a98803743f25f36377790edc4b6315639aade7 (patch)
treea02b8d244263bac7d9b3658aaa036b7113931d88 /lib/kernel/src/code_server.erl
parent020953c6080a538c0c3152b92a3ab125f258280b (diff)
parent68731828019e14ef46ef6f2b8bd2c6eb87589a43 (diff)
downloadotp-25a98803743f25f36377790edc4b6315639aade7.tar.gz
otp-25a98803743f25f36377790edc4b6315639aade7.tar.bz2
otp-25a98803743f25f36377790edc4b6315639aade7.zip
Merge branch 'bjorn/kernel/on_load-bug/OTP-9875' into maint
* bjorn/kernel/on_load-bug/OTP-9875: Fix on_load handling in modules loaded by code:load_binary/3
Diffstat (limited to 'lib/kernel/src/code_server.erl')
-rw-r--r--lib/kernel/src/code_server.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/kernel/src/code_server.erl b/lib/kernel/src/code_server.erl
index 32a12e2b52..5d4f2eb70c 100644
--- a/lib/kernel/src/code_server.erl
+++ b/lib/kernel/src/code_server.erl
@@ -1317,15 +1317,21 @@ int_list([H|T]) when is_integer(H) -> int_list(T);
int_list([_|_]) -> false;
int_list([]) -> true.
+load_file(Mod0, {From,_}=Caller, St0) ->
+ Mod = to_atom(Mod0),
+ case pending_on_load(Mod, From, St0) of
+ no -> load_file_1(Mod, Caller, St0);
+ {yes,St} -> {noreply,St}
+ end.
-load_file(Mod, Caller, #state{path=Path,cache=no_cache}=St) ->
+load_file_1(Mod, Caller, #state{path=Path,cache=no_cache}=St) ->
case mod_to_bin(Path, Mod) of
error ->
{reply,{error,nofile},St};
{Mod,Binary,File} ->
try_load_module(File, Mod, Binary, Caller, St)
end;
-load_file(Mod, Caller, #state{cache=Cache}=St0) ->
+load_file_1(Mod, Caller, #state{cache=Cache}=St0) ->
Key = {obj,Mod},
case ets:lookup(Cache, Key) of
[] ->