aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2017-09-04 17:49:38 +0200
committerRickard Green <[email protected]>2017-09-04 17:49:38 +0200
commitb8870376d42b3f629d2dac394925e02f0e6e48ca (patch)
treee80c7ec295d7de83dbf3a9d3d6f78503e92cb5b3
parentffd59fbd9ac262b7aba4b86e7da4992a3e668e24 (diff)
downloadotp-b8870376d42b3f629d2dac394925e02f0e6e48ca.tar.gz
otp-b8870376d42b3f629d2dac394925e02f0e6e48ca.tar.bz2
otp-b8870376d42b3f629d2dac394925e02f0e6e48ca.zip
Fix setnode/3 and erts_net_message()
-rw-r--r--erts/emulator/beam/dist.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/erts/emulator/beam/dist.c b/erts/emulator/beam/dist.c
index a50072fe98..0e4361308f 100644
--- a/erts/emulator/beam/dist.c
+++ b/erts/emulator/beam/dist.c
@@ -1230,8 +1230,7 @@ int erts_net_message(Port *prt,
}
- if (hlen != 0)
- goto data_error;
+ ASSERT(hlen == 0);
if (len == 0) { /* HANDLE TICK !!! */
UnUseTmpHeapNoproc(DIST_CTL_DEFAULT_SIZE);
@@ -1251,11 +1250,6 @@ int erts_net_message(Port *prt,
len--;
}
- if (len == 0) {
- PURIFY_MSG("data error");
- goto data_error;
- }
-
res = erts_prepare_dist_ext(&ede, t, len, dep, dep->cache, &connection_id);
switch (res) {
@@ -3303,8 +3297,10 @@ BIF_RETTYPE setnode_3(BIF_ALIST_3)
if (ERTS_PROC_GET_DIST_ENTRY(proc)) {
if (dep == ERTS_PROC_GET_DIST_ENTRY(proc)
&& (proc->flags & F_DISTRIBUTION)
- && dep->cid == BIF_ARG_2)
+ && dep->cid == BIF_ARG_2) {
+ ERTS_BIF_PREP_RET(ret, erts_make_dhandle(BIF_P, dep));
goto done;
+ }
goto badarg;
}
@@ -3335,8 +3331,10 @@ BIF_RETTYPE setnode_3(BIF_ALIST_3)
if ((pp->drv_ptr->flags & ERL_DRV_FLAG_SOFT_BUSY) == 0)
goto badarg;
- if (dep->cid == BIF_ARG_2 && pp->dist_entry == dep)
+ if (dep->cid == BIF_ARG_2 && pp->dist_entry == dep) {
+ ERTS_BIF_PREP_RET(ret, erts_make_dhandle(BIF_P, dep));
goto done; /* Already set */
+ }
if (dep->status & ERTS_DE_SFLG_EXITING) {
/* Suspend on dist entry waiting for the exit to finish */