Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
cp: fix Ioctl casting for ppc64 (Closes: #8161)
  • Loading branch information
Maksim Panfilov committed Sep 14, 2025
commit 666b3b38523ff6f727e02d389f6e5a524b9fa51d
11 changes: 2 additions & 9 deletions src/uu/cp/src/platform/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,8 @@ where
let dst_file = File::create(&dest)?;
let src_fd = src_file.as_raw_fd();
let dst_fd = dst_file.as_raw_fd();
// Using .try_into().unwrap() is required as glibc, musl & android all have different type for ioctl()
#[allow(clippy::unnecessary_fallible_conversions)]
let result = unsafe {
libc::ioctl(
dst_fd,
linux_raw_sys::ioctl::FICLONE.try_into().unwrap(),
src_fd,
)
};
let result =
unsafe { libc::ioctl(dst_fd, linux_raw_sys::ioctl::FICLONE as libc::Ioctl, src_fd) };
if result == 0 {
return Ok(());
}
Expand Down
Loading