This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Detect closed file descriptors on Windows


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]