Skip to content

Commit a401851

Browse files
committed
std: retry waitid on EINTR in the pidfd wait path
1 parent 29e68fe commit a401851

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • library/std/src/sys/process/unix

library/std/src/sys/process/unix/pidfd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use super::ExitStatus;
22
use crate::io;
33
use crate::os::fd::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
44
use crate::sys::fd::FileDesc;
5-
use crate::sys::{AsInner, FromInner, IntoInner, cvt};
5+
use crate::sys::{AsInner, FromInner, IntoInner, cvt, cvt_r};
66

77
#[cfg(test)]
88
mod tests;
@@ -61,7 +61,7 @@ impl PidFd {
6161

6262
fn waitid(&self, options: libc::c_int) -> io::Result<Option<ExitStatus>> {
6363
let mut siginfo: libc::siginfo_t = unsafe { crate::mem::zeroed() };
64-
let r = cvt(unsafe {
64+
let r = cvt_r(|| unsafe {
6565
libc::waitid(libc::P_PIDFD, self.0.as_raw_fd() as u32, &mut siginfo, options)
6666
});
6767
match r {

0 commit comments

Comments
 (0)