From 16ebf750cfbc3de36cbf2e05eb50669d83c4dbfd Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Wed, 30 Sep 2020 21:30:07 -0700 Subject: Update libc to 0.2.79 This also fixes issues with inconsistent `unsafe` on functions. --- library/std/src/sys/unix/process/process_unix.rs | 26 +++--------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'library/std/src/sys/unix/process/process_unix.rs') diff --git a/library/std/src/sys/unix/process/process_unix.rs b/library/std/src/sys/unix/process/process_unix.rs index 32f456266c9..eb600d2465c 100644 --- a/library/std/src/sys/unix/process/process_unix.rs +++ b/library/std/src/sys/unix/process/process_unix.rs @@ -461,15 +461,7 @@ impl ExitStatus { } fn exited(&self) -> bool { - // On Linux-like OSes this function is safe, on others it is not. See - // libc issue: https://github.com/rust-lang/libc/issues/1888. - #[cfg_attr( - any(target_os = "linux", target_os = "android", target_os = "emscripten"), - allow(unused_unsafe) - )] - unsafe { - libc::WIFEXITED(self.0) - } + libc::WIFEXITED(self.0) } pub fn success(&self) -> bool { @@ -477,23 +469,11 @@ impl ExitStatus { } pub fn code(&self) -> Option { - // On Linux-like OSes this function is safe, on others it is not. See - // libc issue: https://github.com/rust-lang/libc/issues/1888. - #[cfg_attr( - any(target_os = "linux", target_os = "android", target_os = "emscripten"), - allow(unused_unsafe) - )] - if self.exited() { Some(unsafe { libc::WEXITSTATUS(self.0) }) } else { None } + if self.exited() { Some(libc::WEXITSTATUS(self.0)) } else { None } } pub fn signal(&self) -> Option { - // On Linux-like OSes this function is safe, on others it is not. See - // libc issue: https://github.com/rust-lang/libc/issues/1888. - #[cfg_attr( - any(target_os = "linux", target_os = "android", target_os = "emscripten"), - allow(unused_unsafe) - )] - if !self.exited() { Some(unsafe { libc::WTERMSIG(self.0) }) } else { None } + if !self.exited() { Some(libc::WTERMSIG(self.0)) } else { None } } } -- cgit 1.4.1-3-g733a5