Skip to content

Commit

Permalink
Fix use of as_ptr in splice_impl
Browse files Browse the repository at this point in the history
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
  • Loading branch information
NobodyXu committed Jun 21, 2022
1 parent 5c478b4 commit 03e5289
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ fn as_ptr<T>(option: Option<&mut T>) -> *mut T {
#[cfg(target_os = "linux")]
async fn splice_impl(
fd_in: &mut AsyncFd<impl AsRawFd>,
off_in: Option<&mut off64_t>,
mut off_in: Option<&mut off64_t>,
fd_out: &AsyncFd<impl AsRawFd>,
off_out: Option<&mut off64_t>,
mut off_out: Option<&mut off64_t>,
len: usize,
has_more_data: bool,
) -> io::Result<usize> {
Expand All @@ -279,9 +279,9 @@ async fn splice_impl(
let ret = unsafe {
libc::splice(
fd_in.as_raw_fd(),
as_ptr(off_in),
as_ptr(off_in.as_deref_mut()),
fd_out.as_raw_fd(),
as_ptr(off_out),
as_ptr(off_out.as_deref_mut()),
len,
flags,
)
Expand Down

0 comments on commit 03e5289

Please sign in to comment.