From dd8b3090d21757b3280ecb79c404c0747634cfb4 Mon Sep 17 00:00:00 2001 From: Christopher Dryden Date: Fri, 28 Nov 2025 21:24:51 +0000 Subject: [PATCH] Multi platform mechanism for getting error message from libc --- src/uucore/src/lib/features/process.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/uucore/src/lib/features/process.rs b/src/uucore/src/lib/features/process.rs index 02d23231f..1019dfc5c 100644 --- a/src/uucore/src/lib/features/process.rs +++ b/src/uucore/src/lib/features/process.rs @@ -72,8 +72,7 @@ pub fn pid_is_alive(pid: i32) -> bool { if pid <= 0 { return true; } - - unsafe { libc::kill(pid, 0) == 0 || *libc::__errno_location() != libc::ESRCH } + unsafe { libc::kill(pid, 0) == 0 || Errno::last() != Errno::ESRCH } } /// `getsid()` returns the session ID of the process with process ID pid.