Skip to content

Commit d96e995

Browse files
committed
Fix libc removing unsafe on makedev
1 parent 51040e3 commit d96e995

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ once_cell = { version = "1.5.2", optional = true }
4040
[target.'cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", any(target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"), all(target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "powerpc64", target_arch = "riscv64", target_arch = "mips", target_arch = "mips64")))))'.dependencies]
4141
linux-raw-sys = { version = "0.0.46", default-features = false, features = ["general", "errno", "ioctl", "no_std"] }
4242
libc_errno = { package = "errno", version = "0.2.8", default-features = false, optional = true }
43-
libc = { version = "0.2.126", features = ["extra_traits"], optional = true }
43+
libc = { version = "0.2.133", features = ["extra_traits"], optional = true }
4444

4545
# Dependencies for platforms where only libc is supported:
4646
#
4747
# On all other Unix-family platforms, and under Miri, we always use the libc
4848
# backend, so enable its dependencies unconditionally.
4949
[target.'cfg(any(rustix_use_libc, miri, not(all(target_os = "linux", any(target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"), all(target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "powerpc64", target_arch = "riscv64", target_arch = "mips", target_arch = "mips64")))))))'.dependencies]
5050
libc_errno = { package = "errno", version = "0.2.8", default-features = false }
51-
libc = { version = "0.2.126", features = ["extra_traits"] }
51+
libc = { version = "0.2.133", features = ["extra_traits"] }
5252

5353
# Additional dependencies for Linux with the libc backend:
5454
#
@@ -69,7 +69,7 @@ features = [
6969

7070
[dev-dependencies]
7171
tempfile = "3.2.0"
72-
libc = "0.2.126"
72+
libc = "0.2.133"
7373
libc_errno = { package = "errno", version = "0.2.8", default-features = false }
7474
io-lifetimes = { version = "1.0.0-rc1", default-features = false }
7575
# Don't upgrade to serial_test 0.7 for now because it depends on a

src/backend/libc/fs/makedev.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ use crate::fs::Dev;
55
#[cfg(not(any(target_os = "android", target_os = "emscripten")))]
66
#[inline]
77
pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
8-
unsafe { c::makedev(maj, min) }
8+
c::makedev(maj, min)
99
}
1010

1111
#[cfg(all(target_os = "android", not(target_pointer_width = "32")))]
1212
#[inline]
1313
pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
1414
// Android's `makedev` oddly has signed argument types.
15-
unsafe { c::makedev(maj as i32, min as i32) }
15+
c::makedev(maj, min)
1616
}
1717

1818
#[cfg(all(target_os = "android", target_pointer_width = "32"))]
@@ -30,7 +30,7 @@ pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
3030
#[inline]
3131
pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
3232
// Emscripten's `makedev` has a 32-bit return value.
33-
Dev::from(unsafe { c::makedev(maj, min) })
33+
Dev::from(c::makedev(maj, min))
3434
}
3535

3636
#[cfg(not(any(target_os = "android", target_os = "emscripten")))]

0 commit comments

Comments
 (0)