Skip to content

Commit

Permalink
[Rust] Fixed: macOS incorrect errno
Browse files Browse the repository at this point in the history
  • Loading branch information
Sewer56 committed Sep 7, 2023
1 parent a5a2527 commit 97b55be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src-rust/src/internal/locator_header_finder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ impl LocatorHeaderFinder {
#[cfg(any(target_os = "linux", target_os = "macos"))]
fn is_process_running(pid: i32) -> bool {
unsafe {
#[cfg(target_os = "macos")]
return kill(pid, 0) == 0 || *libc::__error() == libc::EPERM;

#[cfg(target_os = "linux")]
return kill(pid, 0) == 0 || *libc::__errno_location() == libc::EPERM;
}
}
Expand Down

0 comments on commit 97b55be

Please sign in to comment.