Skip to content

Commit 8c31f39

Browse files
authored
Merge pull request #8637 from maxfilov/main
cp: fix Ioctl casting for ppc64 (Closes: #8161)
2 parents 8862280 + 666b3b3 commit 8c31f39

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/uu/cp/src/platform/linux.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,8 @@ where
6262
let dst_file = File::create(&dest)?;
6363
let src_fd = src_file.as_raw_fd();
6464
let dst_fd = dst_file.as_raw_fd();
65-
// Using .try_into().unwrap() is required as glibc, musl & android all have different type for ioctl()
66-
#[allow(clippy::unnecessary_fallible_conversions)]
67-
let result = unsafe {
68-
libc::ioctl(
69-
dst_fd,
70-
linux_raw_sys::ioctl::FICLONE.try_into().unwrap(),
71-
src_fd,
72-
)
73-
};
65+
let result =
66+
unsafe { libc::ioctl(dst_fd, linux_raw_sys::ioctl::FICLONE as libc::Ioctl, src_fd) };
7467
if result == 0 {
7568
return Ok(());
7669
}

0 commit comments

Comments
 (0)