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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user