fixed broken waitpid and switched to waitid
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
Jake Hillion 2022-05-19 17:19:52 +01:00
parent 491fb46cb9
commit 4f0f74b859

View File

@ -17,8 +17,8 @@ use std::path::Path;
use nix::fcntl::OFlag;
use nix::sys::socket;
use nix::sys::wait::{waitpid, WaitPidFlag, WaitStatus};
use nix::unistd::{self, Pid};
use nix::sys::wait::{waitid, Id, WaitPidFlag, WaitStatus};
use nix::unistd;
pub struct RunArgs<'a> {
pub spec: Option<&'a Path>,
@ -72,7 +72,7 @@ pub fn run(args: &RunArgs) -> Result<i32> {
let mut exit_code = exitcode::OK;
loop {
let status = match waitpid(Some(Pid::from_raw(-1)), Some(WaitPidFlag::WEXITED)) {
let status = match waitid(Id::All, WaitPidFlag::WEXITED) {
Ok(v) => Ok(v),
Err(nix::Error::ECHILD) => {
info!("all child processes have exited, exiting...");