kernel/fs: Increment pos in readv/writev so long as it's not -1.
This amends 20ac27def6.
I missed an important case in that commit: if pos is not -1,
then movePosition will still be false, but we nonetheless
need to increment the read/write position.
Should fix #18921.
This commit is contained in:
@@ -819,7 +819,7 @@ common_user_vector_io(int fd, off_t pos, const iovec* userVecs, size_t count,
|
||||
else
|
||||
bytesTransferred += (ssize_t)length;
|
||||
|
||||
if (movePosition)
|
||||
if (pos != -1)
|
||||
pos += length;
|
||||
|
||||
if (length < vecs[i].iov_len)
|
||||
@@ -1095,7 +1095,7 @@ _kern_readv(int fd, off_t pos, const iovec* vecs, size_t count)
|
||||
else
|
||||
bytesRead += (ssize_t)length;
|
||||
|
||||
if (movePosition)
|
||||
if (pos != -1)
|
||||
pos += vecs[i].iov_len;
|
||||
}
|
||||
|
||||
@@ -1188,7 +1188,7 @@ _kern_writev(int fd, off_t pos, const iovec* vecs, size_t count)
|
||||
else
|
||||
bytesWritten += (ssize_t)length;
|
||||
|
||||
if (movePosition)
|
||||
if (pos != -1)
|
||||
pos += vecs[i].iov_len;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user