You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Jeff Trawick <tr...@gmail.com> on 2005/10/02 03:27:31 UTC
[PATCH] don't reference revents from poll() if no events were met
Purify on Solaris pointed out that we were referencing uninitialized
storage when checking revents. It was uninitialized (by kernel/libc)
because no conditions were met.
Concerns?
Re: [PATCH] don't reference revents from poll() if no events were met
Posted by Jeff Trawick <tr...@gmail.com>.
On 10/1/05, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> On 10/1/05, Jeff Trawick <tr...@gmail.com> wrote:
> > Purify on Solaris pointed out that we were referencing uninitialized
> > storage when checking revents. It was uninitialized (by kernel/libc)
> > because no conditions were met.
> >
> > Concerns?
>
> The comment should be "caller should look at revents", not
> "rtnevents".
Actually I meant the caller of apr_poll(). But that sort of guidance
is better placed in the documentation (which I'll do).
> Also, it seems like you could
> compare against i, not *nsds, and avoid having to dereference a
> pointer
will-do
Thanks for the comments!
Re: [PATCH] don't reference revents from poll() if no events were met
Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 10/1/05, Jeff Trawick <tr...@gmail.com> wrote:
> Purify on Solaris pointed out that we were referencing uninitialized
> storage when checking revents. It was uninitialized (by kernel/libc)
> because no conditions were met.
>
> Concerns?
The comment should be "caller should look at revents", not
"rtnevents". It's setting rtnevents, based on the values of revents,
so revents is what is being read. Also, it seems like you could
compare against i, not *nsds, and avoid having to dereference a
pointer, but I can't imagine that really matters in this sort of code.
In concept the change seems fine though.
-garrett