From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29176 invoked by alias); 12 Jan 2006 20:22:33 -0000 Received: (qmail 29115 invoked by uid 22791); 12 Jan 2006 20:22:32 -0000 X-Spam-Check-By: sourceware.org Received: from zproxy.gmail.com (HELO zproxy.gmail.com) (64.233.162.207) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 12 Jan 2006 20:22:30 +0000 Received: by zproxy.gmail.com with SMTP id 34so471633nzf for ; Thu, 12 Jan 2006 12:22:29 -0800 (PST) Received: by 10.36.9.16 with SMTP id 16mr2188564nzi; Thu, 12 Jan 2006 12:22:28 -0800 (PST) Received: by 10.37.2.42 with HTTP; Thu, 12 Jan 2006 12:22:28 -0800 (PST) Message-ID: <8f2776cb0601121222j2937998dn2bd5670af1692b3e@mail.gmail.com> Date: Thu, 12 Jan 2006 20:22:00 -0000 From: Jim Blandy To: Mark Mitchell , Christopher Faylor Subject: Re: PATCH: Detect closed file descriptors on Windows Cc: gdb-patches@sources.redhat.com In-Reply-To: <43C67C4C.7090605@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <200601112147.k0BLlatG000696@sethra.codesourcery.com> <8f2776cb0601111639r61642795la665387645e44bfa@mail.gmail.com> <43C67C4C.7090605@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00128.txt.bz2 On 1/12/06, Mark Mitchell wrote: > Jim Blandy wrote: > > On 1/11/06, Mark Mitchell 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.