aboutsummaryrefslogtreecommitdiff
path: root/proc/mgt.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2022-12-21 13:18:55 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-12-21 13:21:44 +0100
commit84f8c49f12bb228e73d80ab82dba2707d3253153 (patch)
tree7403f72649341b4f93f712c0e86f3f8c6eb3145d /proc/mgt.c
parentc644533e2a8cd395997609f7e33b1e38c27e40f0 (diff)
downloadhurd-84f8c49f12bb228e73d80ab82dba2707d3253153.tar.gz
hurd-84f8c49f12bb228e73d80ab82dba2707d3253153.tar.bz2
hurd-84f8c49f12bb228e73d80ab82dba2707d3253153.zip
proc: Add task to hashes before requesting death notify
In case the task dies very early and thus the notification arrives very early.
Diffstat (limited to 'proc/mgt.c')
-rw-r--r--proc/mgt.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/proc/mgt.c b/proc/mgt.c
index 67b361dd..2841d2d7 100644
--- a/proc/mgt.c
+++ b/proc/mgt.c
@@ -926,11 +926,10 @@ complete_proc (struct proc *p, pid_t pid)
defer registering death notifications and adding it to the hash
tables. */
if (pid != HURD_PID_STARTUP)
- {
- proc_death_notify (p);
- add_proc_to_hash (p);
- }
+ add_proc_to_hash (p);
join_pgrp (p);
+ if (pid != HURD_PID_STARTUP)
+ proc_death_notify (p);
}
@@ -1282,8 +1281,8 @@ S_proc_set_init_task(struct proc *callerp,
}
init_proc->p_task = task;
- proc_death_notify (init_proc);
add_proc_to_hash (init_proc);
+ proc_death_notify (init_proc);
return 0;
}