This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: PATCH: Detect closed file descriptors on Windows
On Thu, Jan 12, 2006 at 12:22:28PM -0800, Jim Blandy wrote:
>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.
That would be Windows problem to fix, I think. :-)
>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.
Go ahead and check it in, Mark.
cgf