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
14 changes: 8 additions & 6 deletions tokio/src/fs/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ async fn write_uring(path: &Path, mut buf: OwnedBuf) -> io::Result<()> {
let mut buf_offset: usize = 0;
let mut file_offset: u64 = 0;
while buf_offset < total {
let (n, _buf, _fd) = Op::write_at(fd, buf, buf_offset, file_offset)?.await;
// TODO: handle EINT here
let n = n?;
if n == 0 {
return Err(io::ErrorKind::WriteZero.into());
}
let (res, _buf, _fd) = Op::write_at(fd, buf, buf_offset, file_offset)?.await;

let n = match res {
Ok(0) => return Err(io::ErrorKind::WriteZero.into()),
Ok(n) => n,
Err(e) if e.kind() == io::ErrorKind::Interrupted => 0,
Err(e) => return Err(e),
};

buf = _buf;
fd = _fd;
Expand Down