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 | |
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
-rw-r--r-- | bootstrap/lib/kernel/ebin/net.beam | bin | 608 -> 0 bytes | |||
-rw-r--r-- | erts/emulator/nifs/common/net_nif.c | 8 | ||||
-rw-r--r-- | erts/preloaded/src/net.erl | 22 | ||||
-rw-r--r-- | lib/kernel/src/Makefile | 1 | ||||
-rw-r--r-- | lib/kernel/src/net.erl | 40 | ||||
-rw-r--r-- | lib/stdlib/src/otp_internal.erl | 15 |
6 files changed, 40 insertions, 46 deletions
diff --git a/bootstrap/lib/kernel/ebin/net.beam b/bootstrap/lib/kernel/ebin/net.beam Binary files differdeleted file mode 100644 index 3e971eb0e1..0000000000 --- a/bootstrap/lib/kernel/ebin/net.beam +++ /dev/null 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). + + %% =========================================================================== %% diff --git a/lib/kernel/src/Makefile b/lib/kernel/src/Makefile index 57f17defc8..7db05ebc90 100644 --- a/lib/kernel/src/Makefile +++ b/lib/kernel/src/Makefile @@ -121,7 +121,6 @@ MODULES = \ logger_server \ logger_simple_h \ logger_sup \ - net \ net_adm \ net_kernel \ os \ diff --git a/lib/kernel/src/net.erl b/lib/kernel/src/net.erl deleted file mode 100644 index 2d0ae2ed0c..0000000000 --- a/lib/kernel/src/net.erl +++ /dev/null @@ -1,40 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 1996-2016. 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. -%% You may obtain a copy of the License at -%% -%% http://www.apache.org/licenses/LICENSE-2.0 -%% -%% Unless required by applicable law or agreed to in writing, software -%% distributed under the License is distributed on an "AS IS" BASIS, -%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -%% See the License for the specific language governing permissions and -%% limitations under the License. -%% -%% %CopyrightEnd% -%% --module(net). - -%% Various network functions, kept here for compatibility - --export([call/4, - cast/4, - broadcast/3, - ping/1, - relay/1, - sleep/1]). - --deprecated(module). - -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). - - diff --git a/lib/stdlib/src/otp_internal.erl b/lib/stdlib/src/otp_internal.erl index aaed13ba3a..95d99f0367 100644 --- a/lib/stdlib/src/otp_internal.erl +++ b/lib/stdlib/src/otp_internal.erl @@ -44,8 +44,19 @@ obsolete(Module, Name, Arity) -> no end. -obsolete_1(net, _, _) -> - {deprecated, "module 'net' obsolete; use 'net_adm'"}; +obsolete_1(net, call, 4) -> + {deprecated, {rpc, call, 4}}; +obsolete_1(net, cast, 4) -> + {deprecated, {rpc, cast, 4}}; +obsolete_1(net, broadcast, 3) -> + {deprecated, {rpc, eval_everywhere, 3}}; +obsolete_1(net, ping, 1) -> + {deprecated, {net_adm, ping, 1}}; +obsolete_1(net, sleep, 1) -> + {deprecated, "Use 'receive after T -> ok end' instead"}; +obsolete_1(net, relay, 1) -> + {deprecated, {slave, relay, 1}}; + obsolete_1(erlang, now, 0) -> {deprecated, |