aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded/src
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2019-03-19 18:19:49 +0100
committerMicael Karlberg <[email protected]>2019-04-30 10:58:16 +0200
commitb6c6aba478e314f60647bf2868eb4ebc59d3c719 (patch)
tree042ad1f482213150815293a73393df9ee2c07ec3 /erts/preloaded/src
parent953f39ad8ce262d1104bd7e29338e43153bbd123 (diff)
downloadotp-b6c6aba478e314f60647bf2868eb4ebc59d3c719.tar.gz
otp-b6c6aba478e314f60647bf2868eb4ebc59d3c719.tar.bz2
otp-b6c6aba478e314f60647bf2868eb4ebc59d3c719.zip
[socket|net] Final prep
The config options --[en|dis]able-esock now works as expected.
Diffstat (limited to 'erts/preloaded/src')
-rw-r--r--erts/preloaded/src/erl_init.erl24
-rw-r--r--erts/preloaded/src/net.erl3
2 files changed, 17 insertions, 10 deletions
diff --git a/erts/preloaded/src/erl_init.erl b/erts/preloaded/src/erl_init.erl
index a650367c25..d209c4033b 100644
--- a/erts/preloaded/src/erl_init.erl
+++ b/erts/preloaded/src/erl_init.erl
@@ -35,8 +35,7 @@ start(Mod, BootArgs) ->
erl_tracer:on_load(),
prim_buffer:on_load(),
prim_file:on_load(),
- conditional_load(socket), % socket:on_load(),
- net:on_load(), % This needs to be loaded since it contains 'other' funcs...
+ conditional_load(socket, [socket, net]), % socket:on_load(), net:on_load(),
%% Proceed to the specified boot module
run(Mod, boot, BootArgs).
@@ -49,15 +48,22 @@ run(M, F, A) ->
M:F(A)
end.
-conditional_load(Mod) ->
- conditional_load(Mod, erlang:loaded()).
+conditional_load(CondMod, Mods2Load) ->
+ conditional_load(CondMod, erlang:loaded(), Mods2Load).
-conditional_load(_Mod, []) ->
+conditional_load(_CondMod, [], _Mods2LOad) ->
ok;
-conditional_load(Mod, [Mod|_]) ->
- Mod:on_load();
-conditional_load(Mod, [_|T]) ->
- conditional_load(Mod, T).
+conditional_load(CondMod, [CondMod|_], Mods2Load) ->
+ on_load(Mods2Load);
+conditional_load(CondMod, [_|T], Mods2Load) ->
+ conditional_load(CondMod, T, Mods2Load).
+
+on_load([]) ->
+ ok;
+on_load([Mod|Mods]) ->
+ Mod:on_load(),
+ on_load(Mods).
+
diff --git a/erts/preloaded/src/net.erl b/erts/preloaded/src/net.erl
index a24b5c8ce3..0b069aa5c7 100644
--- a/erts/preloaded/src/net.erl
+++ b/erts/preloaded/src/net.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2018-2018. All Rights Reserved.
+%% Copyright Ericsson AB 2018-2019. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -334,3 +334,4 @@ nif_if_index2name(_Id) ->
nif_if_names() ->
erlang:nif_error(undef).
+