about summary refs log tree commit diff
path: root/library/std/src/sys/unix/process
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2020-09-30 21:30:07 -0700
committerJosh Triplett <josh@joshtriplett.org>2020-10-04 22:12:07 -0700
commit16ebf750cfbc3de36cbf2e05eb50669d83c4dbfd (patch)
tree0ba09fa586c6607d774fa669c853ef366dc6abc7 /library/std/src/sys/unix/process
parentefbaa413061c2a6e52f06f00a60ee7830fcf3ea5 (diff)
downloadrust-16ebf750cfbc3de36cbf2e05eb50669d83c4dbfd.tar.gz
rust-16ebf750cfbc3de36cbf2e05eb50669d83c4dbfd.zip
Update libc to 0.2.79
This also fixes issues with inconsistent `unsafe` on functions.
Diffstat (limited to 'library/std/src/sys/unix/process')
-rw-r--r--library/std/src/sys/unix/process/process_unix.rs26
1 files changed, 3 insertions, 23 deletions
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<i32> {
-        // 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<i32> {
-        // 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 }
     }
 }