kernel/fs: Fix readv/writev after the seek-disabled refactor.

This fixes a regression introduced in 34fcf3d9ea.

That commit correctly adjusted the "pos" checks at the top of these
functions, but missed that there was a place in the loop where pos
is incremented. After the first increment, we would have a non-zero
pos, and so the new checks in the actual read/write routines would
return an error, meaning that only the first iovec was ever processed.

This fixes WINE following the aforementioned change.
This commit is contained in:
Augustin Cavalier
2024-06-25 20:46:54 -04:00
parent 32c59a45e1
commit 20ac27def6
+6 -3
View File
@@ -814,7 +814,8 @@ common_user_vector_io(int fd, off_t pos, const iovec* userVecs, size_t count,
else
bytesTransferred += (ssize_t)length;
pos += length;
if (movePosition)
pos += length;
if (length < vecs[i].iov_len)
break;
@@ -1089,7 +1090,8 @@ _kern_readv(int fd, off_t pos, const iovec* vecs, size_t count)
else
bytesRead += (ssize_t)length;
pos += vecs[i].iov_len;
if (movePosition)
pos += vecs[i].iov_len;
}
if (movePosition)
@@ -1181,7 +1183,8 @@ _kern_writev(int fd, off_t pos, const iovec* vecs, size_t count)
else
bytesWritten += (ssize_t)length;
pos += vecs[i].iov_len;
if (movePosition)
pos += vecs[i].iov_len;
}
if (movePosition)