Skip to content

Commit

Permalink
chore: Fix warnings from signal being only variant
Browse files Browse the repository at this point in the history
Signed-off-by: John Nunley <dev@notgull.net>
  • Loading branch information
notgull committed Feb 11, 2024
1 parent ee44da4 commit e988f4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/reaper/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
//! test to see if pidfd is supported first. If it is, we use wait. If not, we use
//! signal.

#![allow(irrefutable_let_patterns)]

/// Enable the waiting reaper.
#[cfg(any(target_os = "linux", target_os = "android"))]
macro_rules! cfg_wait {
Expand Down
7 changes: 6 additions & 1 deletion src/reaper/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,13 @@ cfg_if::cfg_if! {
/// Register a process object into this pipe.
fn register(&self, child: &std::process::Child) -> io::Result<()> {
// Called when a child exits.
#[allow(clippy::infallible_destructuring_match)]
unsafe extern "system" fn callback(_: *mut c_void, _: BOOLEAN) {
crate::Reaper::get().sys.pipe.sender.try_send(()).ok();
let reaper = match &crate::Reaper::get().sys {
super::Reaper::Signal(reaper) => reaper,
};

reaper.pipe.sender.try_send(()).ok();
}

// Register this child process to invoke `callback` on exit.
Expand Down

0 comments on commit e988f4c

Please sign in to comment.