diff options
author | Micael Karlberg <[email protected]> | 2018-06-11 14:40:58 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2018-09-18 14:50:18 +0200 |
commit | f2a28200a826af65596bb554b014d2c93b6314a7 (patch) | |
tree | 314869b440b12370a8007817fc75906d5a8da508 /erts | |
parent | cc08971508f3515f9f3b6c406ff0f6a186b24f6b (diff) | |
download | otp-f2a28200a826af65596bb554b014d2c93b6314a7.tar.gz otp-f2a28200a826af65596bb554b014d2c93b6314a7.tar.bz2 otp-f2a28200a826af65596bb554b014d2c93b6314a7.zip |
[net-nif] Removed the old net module
The old net module (in kernel) (deprecated) was removed and its
function(s) has been moved into the new module.
Also a minor updated to the info function.
OTP-14831
Diffstat (limited to 'erts')
-rw-r--r-- | erts/emulator/nifs/common/net_nif.c | 8 | ||||
-rw-r--r-- | erts/preloaded/src/net.erl | 22 |
2 files changed, 27 insertions, 3 deletions
diff --git a/erts/emulator/nifs/common/net_nif.c b/erts/emulator/nifs/common/net_nif.c index 134b02d178..328fb52ac3 100644 --- a/erts/emulator/nifs/common/net_nif.c +++ b/erts/emulator/nifs/common/net_nif.c @@ -669,13 +669,15 @@ ERL_NIF_TERM nif_info(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) { - ERL_NIF_TERM info; + ERL_NIF_TERM info, tmp; NDBG( ("info -> entry\r\n") ); - info = enif_make_new_map(env); + tmp = enif_make_new_map(env); + if (!enif_make_map_put(env, tmp, atom_debug, BOOL2ATOM(data.debug), &info)) + info = tmp; - NDBG( ("info -> done\r\n") ); + NDBG( ("info -> done: %T\r\n", info) ); return info; } diff --git a/erts/preloaded/src/net.erl b/erts/preloaded/src/net.erl index 3c010871c0..54b3790dd5 100644 --- a/erts/preloaded/src/net.erl +++ b/erts/preloaded/src/net.erl @@ -36,6 +36,14 @@ if_names/0 ]). +%% Deprecated functions from the "old" net module +-export([call/4, + cast/4, + broadcast/3, + ping/1, + relay/1, + sleep/1]). + -export_type([ ip_address/0, ip4_address/0, @@ -103,6 +111,20 @@ -type network_interface_index() :: non_neg_integer(). +%% =========================================================================== +%% +%% D E P R E C A T E D F U N C T I O N S +%% +%% =========================================================================== + +call(N,M,F,A) -> rpc:call(N,M,F,A). +cast(N,M,F,A) -> rpc:cast(N,M,F,A). +broadcast(M,F,A) -> rpc:eval_everywhere(M,F,A). +ping(Node) -> net_adm:ping(Node). +sleep(T) -> receive after T -> ok end. +relay(X) -> slave:relay(X). + + %% =========================================================================== %% |