diff options
author | Micael Karlberg <[email protected]> | 2019-03-07 17:27:44 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2019-04-30 10:58:16 +0200 |
commit | 9e34d5b91fda4c1021090fa00a8921cc2c8d2cb8 (patch) | |
tree | 8580ab0743b2dee79169b6b30af2d6b225ef7704 /erts/preloaded | |
parent | 759ec896d7f254db2996cbb503c1ef883e6714b0 (diff) | |
download | otp-9e34d5b91fda4c1021090fa00a8921cc2c8d2cb8.tar.gz otp-9e34d5b91fda4c1021090fa00a8921cc2c8d2cb8.tar.bz2 otp-9e34d5b91fda4c1021090fa00a8921cc2c8d2cb8.zip |
[socket] Preliminary - make socket configurable
Preliminary work to make socket configurable (enable and disable).
OTP-15658
Diffstat (limited to 'erts/preloaded')
-rw-r--r-- | erts/preloaded/src/erl_init.erl | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/erts/preloaded/src/erl_init.erl b/erts/preloaded/src/erl_init.erl index 6edead362c..a650367c25 100644 --- a/erts/preloaded/src/erl_init.erl +++ b/erts/preloaded/src/erl_init.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2016. All Rights Reserved. +%% Copyright Ericsson AB 2000-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. @@ -35,8 +35,8 @@ start(Mod, BootArgs) -> erl_tracer:on_load(), prim_buffer:on_load(), prim_file:on_load(), - socket:on_load(), - net:on_load(), + conditional_load(socket), % socket:on_load(), + net:on_load(), % This needs to be loaded since it contains 'other' funcs... %% Proceed to the specified boot module run(Mod, boot, BootArgs). @@ -48,3 +48,17 @@ run(M, F, A) -> true -> M:F(A) end. + +conditional_load(Mod) -> + conditional_load(Mod, erlang:loaded()). + +conditional_load(_Mod, []) -> + ok; +conditional_load(Mod, [Mod|_]) -> + Mod:on_load(); +conditional_load(Mod, [_|T]) -> + conditional_load(Mod, T). + + + + |