diff options
author | Sverker Eriksson <[email protected]> | 2015-11-26 19:56:51 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2015-11-26 19:56:51 +0100 |
commit | 4e91911aec363d21ea2d6ff7d5f8e1888b0aa8f9 (patch) | |
tree | 5b151ec5340a85af698ae3bceb21a2a8ab390548 /erts/emulator/beam/dist.c | |
parent | a89f1cd881396fc6445b7d790ee2f5b7ae5a6031 (diff) | |
parent | 949de78331b9c4ecb9c628bb651cecb113790e2e (diff) | |
download | otp-4e91911aec363d21ea2d6ff7d5f8e1888b0aa8f9.tar.gz otp-4e91911aec363d21ea2d6ff7d5f8e1888b0aa8f9.tar.bz2 otp-4e91911aec363d21ea2d6ff7d5f8e1888b0aa8f9.zip |
Merge branch 'sverk/setnode-rename-bug/OTP-13076' into maint
* sverk/setnode-rename-bug/OTP-13076:
erts: Fix bug in setnode/2
erts: Remove ERTS_PSD_DIST_ENTRY
erts: Remove faulty ASSERT in erts_proc_*_refc
Diffstat (limited to 'erts/emulator/beam/dist.c')
-rw-r--r-- | erts/emulator/beam/dist.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/erts/emulator/beam/dist.c b/erts/emulator/beam/dist.c index 0bbcc5f966..4846133aa6 100644 --- a/erts/emulator/beam/dist.c +++ b/erts/emulator/beam/dist.c @@ -2576,7 +2576,9 @@ int distribution_info(int to, void *arg) /* Called by break handler */ } for (dep = erts_not_connected_dist_entries; dep; dep = dep->next) { - info_dist_entry(to, arg, dep, 0, 0); + if (dep != erts_this_dist_entry) { + info_dist_entry(to, arg, dep, 0, 0); + } } return(0); @@ -2654,13 +2656,8 @@ BIF_RETTYPE setnode_2(BIF_ALIST_2) if (!net_kernel) goto error; - /* By setting dist_entry==erts_this_dist_entry and DISTRIBUTION on - net_kernel do_net_exist will be called when net_kernel - is terminated !! */ - (void) ERTS_PROC_SET_DIST_ENTRY(net_kernel, - ERTS_PROC_LOCK_MAIN, - erts_this_dist_entry); - erts_refc_inc(&erts_this_dist_entry->refc, 2); + /* By setting F_DISTRIBUTION on net_kernel, + * do_net_exist will be called when net_kernel is terminated !! */ net_kernel->flags |= F_DISTRIBUTION; if (net_kernel != BIF_P) @@ -3021,11 +3018,11 @@ BIF_RETTYPE nodes_1(BIF_ALIST_1) erts_smp_rwmtx_rlock(&erts_dist_table_rwmtx); - ASSERT(erts_no_of_not_connected_dist_entries >= 0); + ASSERT(erts_no_of_not_connected_dist_entries > 0); ASSERT(erts_no_of_hidden_dist_entries >= 0); ASSERT(erts_no_of_visible_dist_entries >= 0); if(not_connected) - length += erts_no_of_not_connected_dist_entries; + length += (erts_no_of_not_connected_dist_entries - 1); if(hidden) length += erts_no_of_hidden_dist_entries; if(visible) @@ -3047,8 +3044,10 @@ BIF_RETTYPE nodes_1(BIF_ALIST_1) #endif if(not_connected) for(dep = erts_not_connected_dist_entries; dep; dep = dep->next) { - result = CONS(hp, dep->sysname, result); - hp += 2; + if (dep != erts_this_dist_entry) { + result = CONS(hp, dep->sysname, result); + hp += 2; + } } if(hidden) for(dep = erts_hidden_dist_entries; dep; dep = dep->next) { |