Skip to content

Commit 1a9cd72

Browse files
committed
Update nix
1 parent 6e2544d commit 1a9cd72

File tree

2 files changed

+47
-40
lines changed

2 files changed

+47
-40
lines changed

Cargo.lock

Lines changed: 42 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/linux/zygote.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ fn print_diagnostics(path: &OsStr, out: &mut dyn Write) {
132132
}
133133
}
134134

135-
extern "C" fn do_exec(mut arg: DoExecArg) -> ! {
135+
fn do_exec(mut arg: DoExecArg) -> ! {
136136
use std::os::unix::io::FromRawFd;
137137
unsafe {
138138
let stderr_fd = libc::dup(2);
@@ -324,14 +324,10 @@ fn timed_wait(pid: Pid, timeout: Option<time::Duration>) -> crate::Result<Option
324324
}
325325
// TL&DR - select([ready_r], timeout)
326326
let mut poll_fd_info = [nix::poll::PollFd::new(end_r, nix::poll::PollFlags::POLLIN)];
327-
let timeout = match timeout {
328-
Some(timeout) => {
329-
nix::sys::time::TimeSpec::nanoseconds(timeout.subsec_nanos() as i64)
330-
+ nix::sys::time::TimeSpec::seconds(timeout.as_secs() as i64)
331-
}
332-
// TODO fix `ppoll` in nix
333-
None => nix::sys::time::TimeSpec::seconds(1_000_000_000),
334-
};
327+
let timeout = timeout.map(|timeout| {
328+
nix::sys::time::TimeSpec::nanoseconds(timeout.subsec_nanos() as i64)
329+
+ nix::sys::time::TimeSpec::seconds(timeout.as_secs() as i64)
330+
});
335331
let ret = loop {
336332
let poll_ret = nix::poll::ppoll(
337333
&mut poll_fd_info[..],

0 commit comments

Comments
 (0)