From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6929 invoked by alias); 18 Apr 2005 21:45:32 -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 6916 invoked from network); 18 Apr 2005 21:45:26 -0000 Received: from unknown (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org with SMTP; 18 Apr 2005 21:45:26 -0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.0/8.13.0) with ESMTP id j3ILi6Ig018530; Mon, 18 Apr 2005 23:44:06 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.4/8.13.3) with ESMTP id j3ILi6pM007951; Mon, 18 Apr 2005 23:44:06 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id j3ILi13s009477; Mon, 18 Apr 2005 23:44:01 +0200 (CEST) Date: Mon, 18 Apr 2005 21:45:00 -0000 Message-Id: <200504182144.j3ILi13s009477@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: mark@codesourcery.com CC: gdb-patches@sources.redhat.com In-reply-to: <4263CCA8.40800@codesourcery.com> (message from Mark Mitchell on Mon, 18 Apr 2005 08:05:12 -0700) Subject: Re: Windows patch status? References: <4263CCA8.40800@codesourcery.com> X-SW-Source: 2005-04/txt/msg00205.txt.bz2 Date: Mon, 18 Apr 2005 08:05:12 -0700 From: Mark Mitchell Mark -- After our last discussion, I posted a revised patch here: http://sources.redhat.com/ml/gdb-patches/2005-04/msg00054.html I believe that version reflects the improvements you requested. Have you had a chance to look at it? Oops. Missed it again. I looked at it now. It's possible to "#define ioctl ioctlsocket" so that ioctl doesn't need to change. However, I think it would be very confusing to do "#define close closesocket" because there's already a Windows runtime library function called "close" -- it just doesn't work on sockets. So, in the version of the patch that's attached, we still do have a call to closesocket. But the code only uses close for sockets isn't it? The point I'm trying to make is that most people changing this file will be familliar with POSIX but not with the stupid Windows API. I really want this file to look as much as POSIX as possible. Given that this file is all about sockets, I think the #define close closesocket might actually prevent people who are not familliar with windows from using close() where they should use closesocket(). So I'd still like you to change this. + delta = (timeout == 0 ? 0 : 1); + while (1) + { + + /* N.B. The UI may destroy our world (for instance by calling + remote_stop,) in which case we want to get out of here as + quickly as possible. It is not safe to touch scb, since Can you remove the extra blank line here? + /* If we got a character or an error back from wait_for, then we can + break from the loop before the timeout is completed. */ + + if (status != SERIAL_TIMEOUT) + { + break; + } and here (and get rid of the redundant braces. + /* If we have exhausted the original timeout, then generate + a SERIAL_TIMEOUT, and pass it out of the loop. */ + + else if (timeout == 0) + { + status = SERIAL_TIMEOUT; and get rid of that blank line too. + if (status <= 0) + { + if (status == 0) + return SERIAL_TIMEOUT; /* 0 chars means timeout [may need to + distinguish between EOF & timeouts + someday] */ + else + return SERIAL_ERROR; /* Got an error from read */ + } Please give these long comments their own line, and make them full sentences (full stop and two spaces at the end, you know the drill). With those changes, please go ahead and check this in. Mark