Skip to content

Commit 91b1724

Browse files
committed
Multi platform mechanism for getting error message from libc
1 parent 8d48ca3 commit 91b1724

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/uucore/src/lib/features/process.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ pub fn pid_is_alive(pid: i32) -> bool {
7272
if pid <= 0 {
7373
return true;
7474
}
75-
76-
unsafe { libc::kill(pid, 0) == 0 || *libc::__errno_location() != libc::ESRCH }
75+
unsafe { libc::kill(pid, 0) == 0 || Errno::last() != Errno::ESRCH }
7776
}
7877

7978
/// `getsid()` returns the session ID of the process with process ID pid.

0 commit comments

Comments
 (0)