On Fri, Nov 08, 2024 at 08:08:06PM +0100, Wolfgang Walther wrote:
> @@ -68,7 +68,7 @@ pg_preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset)
> }
> sum += part;
> offset += part;
> - if (part < iov[i].iov_len)
> + if ((size_t) part < iov[i].iov_len)
> return sum;
> }
> return sum;
> @@ -107,7 +107,7 @@ pg_pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset)
> }
> sum += part;
> offset += part;
> - if (part < iov[i].iov_len)
> + if ((size_t) part < iov[i].iov_len)
> return sum;
> }
> return sum;
This looks correct to me. At this point in the code, we know that part >=
0, so casting it to an unsigned long ought to be okay.
--
nathan