summaryrefslogtreecommitdiff
path: root/src/kernel/proc.c
diff options
context:
space:
mode:
authordzwdz2023-08-27 02:06:32 +0200
committerdzwdz2023-08-27 02:06:32 +0200
commite43939bcc6123e02314aa403eef94d5ace441f7f (patch)
treeac0cea10e8708ae1a6a7a400257c4bc59175a91f /src/kernel/proc.c
parent1f938c20b4a82ca1267ab9a1ec0922878a21ca6b (diff)
ports: qbe, cproc :^)
Diffstat (limited to 'src/kernel/proc.c')
-rw-r--r--src/kernel/proc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/kernel/proc.c b/src/kernel/proc.c
index 3ef35c0..cd9db9b 100644
--- a/src/kernel/proc.c
+++ b/src/kernel/proc.c
@@ -349,10 +349,14 @@ void proc_tryreap(Proc *dead) {
if (parent->state != PS_WAITS4CHILDDEATH) {
return; /* don't reap yet */
}
+ uint32_t pid = proc_ns_id(parent->pns, dead);
+ if (parent->awaited_death.pid && parent->awaited_death.pid != pid) {
+ return; /* we're not The One */
+ }
if (parent->awaited_death.legacy) {
regs_savereturn(&parent->regs, dead->death_msg);
} else {
- regs_savereturn(&parent->regs, proc_ns_id(parent->pns, dead));
+ regs_savereturn(&parent->regs, pid);
if (parent->awaited_death.out) {
struct sys_wait2 __user *out = parent->awaited_death.out;
struct sys_wait2 data;