Skip to content

Commit

Permalink
Always store child pid
Browse files Browse the repository at this point in the history
Keep the mapping of all living child processes so that we'll be able
to iterate over them to clean up, rather than only storing the
children which have an associated port.
  • Loading branch information
adamwight committed Feb 19, 2025
1 parent be3ca1a commit 7bf33ef
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions erts/emulator/sys/unix/erl_child_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,13 +644,10 @@ static Hash *forker_hash;

static void add_os_pid_to_port_id_mapping(Eterm port_id, pid_t os_pid)
{
if (port_id != THE_NON_VALUE) {
/* exit status report requested */
ErtsSysExitStatus es;
es.os_pid = os_pid;
es.port_id = port_id;
hash_put(forker_hash, &es);
}
ErtsSysExitStatus es;
es.os_pid = os_pid;
es.port_id = port_id;
hash_put(forker_hash, &es);
}

static Eterm get_port_id(pid_t os_pid)
Expand Down

0 comments on commit 7bf33ef

Please sign in to comment.