bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnulib] Updates to poll module


From: Bruno Haible
Subject: Re: [bug-gnulib] Updates to poll module
Date: Thu, 28 Sep 2006 23:21:53 +0200
User-agent: KMail/1.9.1

Paolo Bonzini wrote:
> +             do
> +               r = ioctl (pfd[i].fd, FIONREAD, &avail);
> +             while (r == -1 && (errno == EAGAIN || errno == EINTR));
> +             if (avail < 0)
> +               avail = 0;

When ioctl returns -1, maybe because FIONREAD is not supported or so,
this loops endlessly.

> +                 errno = 0;

What's the purpose of that? If recv() needs errro to be 0 upon entry,
this statement should come before the recv() call. It cannot be needed
for the caller, since at this point it is guaranteed that the function
returns with "return rc;" which is positive.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]