mirror of https://github.com/rust-lang/rust.git
Update libc to 0.2.79
This also fixes issues with inconsistent `unsafe` on functions.
This commit is contained in:
parent
efbaa41306
commit
16ebf750cf
|
@ -1660,9 +1660,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
|||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.77"
|
||||
version = "0.2.79"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f2f96b10ec2560088a8e76961b00d47107b3a625fecb76dedb29ee7ccbf98235"
|
||||
checksum = "2448f6066e80e3bfc792e9c98bf705b4b0fc6e8ef5b43e5889aff0eaa9c58743"
|
||||
dependencies = [
|
||||
"rustc-std-workspace-core",
|
||||
]
|
||||
|
|
|
@ -16,7 +16,7 @@ cfg-if = { version = "0.1.8", features = ['rustc-dep-of-std'] }
|
|||
panic_unwind = { path = "../panic_unwind", optional = true }
|
||||
panic_abort = { path = "../panic_abort" }
|
||||
core = { path = "../core" }
|
||||
libc = { version = "0.2.77", default-features = false, features = ['rustc-dep-of-std'] }
|
||||
libc = { version = "0.2.79", default-features = false, features = ['rustc-dep-of-std'] }
|
||||
compiler_builtins = { version = "0.1.35" }
|
||||
profiler_builtins = { path = "../profiler_builtins", optional = true }
|
||||
unwind = { path = "../unwind" }
|
||||
|
|
|
@ -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 }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ doc = false
|
|||
|
||||
[dependencies]
|
||||
core = { path = "../core" }
|
||||
libc = { version = "0.2.51", features = ['rustc-dep-of-std'], default-features = false }
|
||||
libc = { version = "0.2.79", features = ['rustc-dep-of-std'], default-features = false }
|
||||
compiler_builtins = "0.1.0"
|
||||
cfg-if = "0.1.8"
|
||||
|
||||
|
|
Loading…
Reference in New Issue