Skip to content

Commit

Permalink
Fix macos process helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Nukesor committed May 31, 2020
1 parent 5ad5fc6 commit 628dcff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions daemon/linux/process_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use ::nix::{
use procfs::process::all_processes;

/// A small helper to send a signal to all direct child processes of a specific task.
/// `pid` is the process id of the main task id. I.e the parent pid of the child processes.
pub fn send_signal_to_children(pid: i32, signal: Signal) {
let children = all_processes()
.unwrap()
Expand Down
3 changes: 2 additions & 1 deletion daemon/macos/process_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use ::nix::{
use psutil::process::processes;

/// A small helper to send a signal to all direct child processes of a specific task.
/// `pid` is the process id of the main task id. I.e the parent pid of the child processes.
pub fn send_signal_to_children(pid: i32, signal: Signal) {
let all_processes = match processes() {
Err(error) => {
Expand All @@ -20,7 +21,7 @@ pub fn send_signal_to_children(pid: i32, signal: Signal) {
.map(|result| result.unwrap())
.filter(|process| {
if let Ok(ppid) = process.ppid() {
if Some(ppid) = ppid {
if let Some(ppid) = ppid {
return ppid as i32 == pid;
}
}
Expand Down

0 comments on commit 628dcff

Please sign in to comment.