Skip to content

Commit

Permalink
fix: hurd build, stat64.st_fsid was renamed to st_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveLauC committed Nov 30, 2024
1 parent dd2837e commit 43ae473
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions library/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ dependencies = [

[[package]]
name = "libc"
version = "0.2.162"
version = "0.2.167"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398"
checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc"
dependencies = [
"rustc-std-workspace-core",
]
Expand Down
2 changes: 1 addition & 1 deletion library/std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ miniz_oxide = { version = "0.7.0", optional = true, default-features = false }
addr2line = { version = "0.22.0", optional = true, default-features = false }

[target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
libc = { version = "0.2.162", default-features = false, features = [
libc = { version = "0.2.167", default-features = false, features = [
'rustc-dep-of-std',
], public = true }

Expand Down
2 changes: 1 addition & 1 deletion library/std/src/os/hurd/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ pub trait MetadataExt {
#[stable(feature = "metadata_ext", since = "1.1.0")]
impl MetadataExt for Metadata {
fn st_dev(&self) -> u64 {
self.as_inner().as_inner().st_fsid as u64
self.as_inner().as_inner().st_dev as u64
}
fn st_ino(&self) -> u64 {
self.as_inner().as_inner().st_ino as u64
Expand Down
2 changes: 2 additions & 0 deletions library/std/src/sys/pal/unix/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,13 @@ pub fn current_exe() -> io::Result<PathBuf> {
pub fn current_exe() -> io::Result<PathBuf> {
unsafe {
let mut sz: u32 = 0;
#[expect(deprecated)]
libc::_NSGetExecutablePath(ptr::null_mut(), &mut sz);
if sz == 0 {
return Err(io::Error::last_os_error());
}
let mut v: Vec<u8> = Vec::with_capacity(sz as usize);
#[expect(deprecated)]
let err = libc::_NSGetExecutablePath(v.as_mut_ptr() as *mut i8, &mut sz);
if err != 0 {
return Err(io::Error::last_os_error());
Expand Down

0 comments on commit 43ae473

Please sign in to comment.