PATCH: Detect closed file descriptors on Windows

Jim Blandy jimb@red-bean.com
Thu Jan 12 20:22:00 GMT 2006


On 1/12/06, Mark Mitchell <mark@codesourcery.com> wrote:
> Jim Blandy wrote:
> > On 1/11/06, Mark Mitchell <mark@codesourcery.com> wrote:
> >
> >>        gdb_assert (!FD_ISSET (fd, writefds));
> >>!       if (FD_ISSET (fd, readfds)
> >>!         && !FD_ISSET (fd, exceptfds))
> >>!       continue;
> >
> >
> > Don't you mean, "if (! FD_ISSET (fd, readfds) && ..."?
>
> Definitely.
>
> I got lucky because GDB (at least in simple cases) tends to pass the
> same set of descriptors for readfds and exceptfds.
>
> OK with that change?

Yes, it looks fine to me.

It's a shame that even though readfds, writefds, and exceptfds look
parallel in the interface, each of them is handled rather differently
in the code (i.e., writefds is asserted to be correct as passed;
exceptfds is made correct by the handle-collecting loop; and readfds
is pared down to the correct set after the call).  But I don't think
that's your problem to fix.

If I'm reading gdb/MAINTAINERS right, Chris Faylor is the one who
needs to approve this; his entry doesn't restrict his oversight to
Cygwin Windows, which is what I thought he was interested in.



More information about the Gdb-patches mailing list