Skip to content

Commit 16ebf75

Browse files
committed
Update libc to 0.2.79
This also fixes issues with inconsistent `unsafe` on functions.
1 parent efbaa41 commit 16ebf75

File tree

4 files changed

+7
-27
lines changed

4 files changed

+7
-27
lines changed

Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -1660,9 +1660,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
16601660

16611661
[[package]]
16621662
name = "libc"
1663-
version = "0.2.77"
1663+
version = "0.2.79"
16641664
source = "registry+https://github.com/rust-lang/crates.io-index"
1665-
checksum = "f2f96b10ec2560088a8e76961b00d47107b3a625fecb76dedb29ee7ccbf98235"
1665+
checksum = "2448f6066e80e3bfc792e9c98bf705b4b0fc6e8ef5b43e5889aff0eaa9c58743"
16661666
dependencies = [
16671667
"rustc-std-workspace-core",
16681668
]

library/std/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ cfg-if = { version = "0.1.8", features = ['rustc-dep-of-std'] }
1616
panic_unwind = { path = "../panic_unwind", optional = true }
1717
panic_abort = { path = "../panic_abort" }
1818
core = { path = "../core" }
19-
libc = { version = "0.2.77", default-features = false, features = ['rustc-dep-of-std'] }
19+
libc = { version = "0.2.79", default-features = false, features = ['rustc-dep-of-std'] }
2020
compiler_builtins = { version = "0.1.35" }
2121
profiler_builtins = { path = "../profiler_builtins", optional = true }
2222
unwind = { path = "../unwind" }

library/std/src/sys/unix/process/process_unix.rs

+3-23
Original file line numberDiff line numberDiff line change
@@ -461,39 +461,19 @@ impl ExitStatus {
461461
}
462462

463463
fn exited(&self) -> bool {
464-
// On Linux-like OSes this function is safe, on others it is not. See
465-
// libc issue: https://github.com/rust-lang/libc/issues/1888.
466-
#[cfg_attr(
467-
any(target_os = "linux", target_os = "android", target_os = "emscripten"),
468-
allow(unused_unsafe)
469-
)]
470-
unsafe {
471-
libc::WIFEXITED(self.0)
472-
}
464+
libc::WIFEXITED(self.0)
473465
}
474466

475467
pub fn success(&self) -> bool {
476468
self.code() == Some(0)
477469
}
478470

479471
pub fn code(&self) -> Option<i32> {
480-
// On Linux-like OSes this function is safe, on others it is not. See
481-
// libc issue: https://github.com/rust-lang/libc/issues/1888.
482-
#[cfg_attr(
483-
any(target_os = "linux", target_os = "android", target_os = "emscripten"),
484-
allow(unused_unsafe)
485-
)]
486-
if self.exited() { Some(unsafe { libc::WEXITSTATUS(self.0) }) } else { None }
472+
if self.exited() { Some(libc::WEXITSTATUS(self.0)) } else { None }
487473
}
488474

489475
pub fn signal(&self) -> Option<i32> {
490-
// On Linux-like OSes this function is safe, on others it is not. See
491-
// libc issue: https://github.com/rust-lang/libc/issues/1888.
492-
#[cfg_attr(
493-
any(target_os = "linux", target_os = "android", target_os = "emscripten"),
494-
allow(unused_unsafe)
495-
)]
496-
if !self.exited() { Some(unsafe { libc::WTERMSIG(self.0) }) } else { None }
476+
if !self.exited() { Some(libc::WTERMSIG(self.0)) } else { None }
497477
}
498478
}
499479

library/unwind/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ doc = false
1414

1515
[dependencies]
1616
core = { path = "../core" }
17-
libc = { version = "0.2.51", features = ['rustc-dep-of-std'], default-features = false }
17+
libc = { version = "0.2.79", features = ['rustc-dep-of-std'], default-features = false }
1818
compiler_builtins = "0.1.0"
1919
cfg-if = "0.1.8"
2020

0 commit comments

Comments
 (0)