From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8690 invoked by alias); 3 Dec 2001 20:02:49 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 8620 invoked from network); 3 Dec 2001 20:02:44 -0000 Received: from unknown (HELO localhost.cygnus.com) (216.138.202.10) by sources.redhat.com with SMTP; 3 Dec 2001 20:02:44 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.cygnus.com (Postfix) with ESMTP id 7CD543D59; Mon, 3 Dec 2001 15:02:44 -0500 (EST) Message-ID: <3C0BDA64.7080902@cygnus.com> Date: Mon, 03 Dec 2001 12:02:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.3) Gecko/20011020 X-Accept-Language: en-us MIME-Version: 1.0 To: "Martin M. Hunt" Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] new tcp_open References: <200112031918.LAA18199@cygnus.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2001-12/txt/msg00055.txt.bz2 Outch! > /* Use Non-blocking connect. connect() will return 0 if connected already. */ > n = connect (scb->fd, (struct sockaddr *) &sockaddr, sizeof (sockaddr)); > if (n) > { Should this also be checking errno to confirm that it was EINPROGRESS? Little point in trying to connect to a socket that isn't valid. > t.tv_usec = 500000; /* 0.5 seconds */ > > n = select (scb->fd + 1, &rset, &wset, NULL, &t); > secs++; > } > while (n == 0 && secs <= TIMEOUT); Can I just suggest tinkering with this so that the 15 seconds is clearer - at present it happens cos 0.5 * 30 = 15. > /* While we wait for the connect to complete */ > /* poll the UI so it can update or the user can */ > /* interrupt. */ That should be a single comment block. Could you please also add a comment to serial.h indicating that serial_open() has the potential to block so that the code must handle that and a true asynchronous open() interface may need to eventually be added to GDB. The only other potential problem I can see is with FIONBIO. Hopefully that is fairly common and where it turns out to not be available something can be worked out. Tried it on cygwin? Otherwise, yes approved. Andrew