Gcc 9 needs some convincing that sopreprbuf really is going to fill
in iov in the call from soreadbuf, even though the failure case
shouldn't happen.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <
20190415121740.9881-1-dgilbert@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
soread(struct socket *so)
{
int n, nn;
soread(struct socket *so)
{
int n, nn;
struct sbuf *sb = &so->so_snd;
struct iovec iov[2];
struct sbuf *sb = &so->so_snd;
struct iovec iov[2];
* No need to check if there's enough room to read.
* soread wouldn't have been called if there weren't
*/
* No need to check if there's enough room to read.
* soread wouldn't have been called if there weren't
*/
- sopreprbuf(so, iov, &n);
+ buf_len = sopreprbuf(so, iov, &n);
+ assert(buf_len != 0);
nn = recv(so->s, iov[0].iov_base, iov[0].iov_len,0);
if (nn <= 0) {
nn = recv(so->s, iov[0].iov_base, iov[0].iov_len,0);
if (nn <= 0) {
* No need to check if there's enough room to read.
* soread wouldn't have been called if there weren't
*/
* No need to check if there's enough room to read.
* soread wouldn't have been called if there weren't
*/
if (sopreprbuf(so, iov, &n) < size)
goto err;
if (sopreprbuf(so, iov, &n) < size)
goto err;