Allow waitpid to be interrupted.

This commit is contained in:
4lDO2
2024-07-20 23:17:31 +02:00
parent 005635083d
commit 51c4be10e0
2 changed files with 23 additions and 18 deletions
+18 -14
View File
@@ -674,13 +674,15 @@ pub fn waitpid(
Some(Ok(ProcessId::from(0)))
}
} else {
let (w_pid, status) = waitpid.receive(
&WaitpidKey {
pid: None,
pgid: Some(pgid),
},
"waitpid pgid",
);
let (w_pid, status) = waitpid
.receive(
&WaitpidKey {
pid: None,
pgid: Some(pgid),
},
"waitpid pgid",
)
.ok_or(Error::new(EINTR))?;
grim_reaper(w_pid, status)
}
} else {
@@ -716,13 +718,15 @@ pub fn waitpid(
Some(Ok(ProcessId::from(0)))
}
} else {
let (w_pid, status) = waitpid.receive(
&WaitpidKey {
pid: Some(pid),
pgid: None,
},
"waitpid pid",
);
let (w_pid, status) = waitpid
.receive(
&WaitpidKey {
pid: Some(pid),
pgid: None,
},
"waitpid pid",
)
.ok_or(Error::new(EINTR))?;
grim_reaper(w_pid, status)
}
};