Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Bump nix and ctrlc crate to resolve audit failures #20558

Merged
merged 3 commits into from
Oct 8, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update to direct error variants
  • Loading branch information
Tyera Eulberg committed Oct 8, 2021
commit 40cea173e5f7c083bf1aaf8c3b50ca1fa0ca0c98
7 changes: 3 additions & 4 deletions install/src/stop_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ pub fn stop_process(process: &mut Child) -> Result<(), io::Error> {
use nix::errno::Errno::{EINVAL, EPERM, ESRCH};
use nix::sys::signal::{kill, Signal};
use nix::unistd::Pid;
use nix::Error::Sys;
use std::io::ErrorKind;
use std::thread;
use std::time::{Duration, Instant};
Expand All @@ -40,17 +39,17 @@ pub fn stop_process(process: &mut Child) -> Result<(), io::Error> {
kill_process(process)?;
}
}
Err(Sys(EINVAL)) => {
Err(EINVAL) => {
println!("Invalid signal. Killing process {}", pid);
kill_process(process)?;
}
Err(Sys(EPERM)) => {
Err(EPERM) => {
return Err(io::Error::new(
ErrorKind::InvalidInput,
format!("Insufficient permissions to signal process {}", pid),
));
}
Err(Sys(ESRCH)) => {
Err(ESRCH) => {
return Err(io::Error::new(
ErrorKind::InvalidInput,
format!("Process {} does not exist", pid),
Expand Down