diff --git a/base/src/ioctl.rs b/base/src/ioctl.rs index a50f689d31..307d5d9381 100644 --- a/base/src/ioctl.rs +++ b/base/src/ioctl.rs @@ -11,16 +11,12 @@ pub unsafe fn ioctl(descriptor: &F, nr: IoctlNr) -> c_int { } /// Run an ioctl with a single value argument. -pub unsafe fn ioctl_with_val( - descriptor: &F, - nr: IoctlNr, - arg: c_ulong, -) -> c_int { +pub unsafe fn ioctl_with_val(descriptor: &dyn AsRawDescriptor, nr: IoctlNr, arg: c_ulong) -> c_int { libc::ioctl(descriptor.as_raw_descriptor(), nr, arg) } /// Run an ioctl with an immutable reference. -pub unsafe fn ioctl_with_ref(descriptor: &F, nr: IoctlNr, arg: &T) -> c_int { +pub unsafe fn ioctl_with_ref(descriptor: &dyn AsRawDescriptor, nr: IoctlNr, arg: &T) -> c_int { libc::ioctl( descriptor.as_raw_descriptor(), nr, @@ -29,8 +25,8 @@ pub unsafe fn ioctl_with_ref(descriptor: &F, nr: IoctlNr, } /// Run an ioctl with a mutable reference. -pub unsafe fn ioctl_with_mut_ref( - descriptor: &F, +pub unsafe fn ioctl_with_mut_ref( + descriptor: &dyn AsRawDescriptor, nr: IoctlNr, arg: &mut T, ) -> c_int { @@ -42,8 +38,8 @@ pub unsafe fn ioctl_with_mut_ref( } /// Run an ioctl with a raw pointer. -pub unsafe fn ioctl_with_ptr( - descriptor: &F, +pub unsafe fn ioctl_with_ptr( + descriptor: &dyn AsRawDescriptor, nr: IoctlNr, arg: *const T, ) -> c_int { @@ -51,8 +47,8 @@ pub unsafe fn ioctl_with_ptr( } /// Run an ioctl with a mutable raw pointer. -pub unsafe fn ioctl_with_mut_ptr( - descriptor: &F, +pub unsafe fn ioctl_with_mut_ptr( + descriptor: &dyn AsRawDescriptor, nr: IoctlNr, arg: *mut T, ) -> c_int {