From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2647 invoked by alias); 8 Aug 2013 05:11:24 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 2627 invoked by uid 89); 8 Aug 2013 05:11:23 -0000 X-Spam-SWARE-Status: No, score=-50.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,RDNS_NONE autolearn=no version=3.3.1 Received: from Unknown (HELO mho-02-ewr.mailhop.org) (204.13.248.72) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 08 Aug 2013 05:11:23 +0000 Received: from pool-173-48-46-190.bstnma.fios.verizon.net ([173.48.46.190] helo=cgf.cx) by mho-02-ewr.mailhop.org with esmtpa (Exim 4.72) (envelope-from ) id 1V7IVH-00090s-O5; Thu, 08 Aug 2013 05:11:15 +0000 Received: from localhost (ednor.casa.cgf.cx [192.168.187.5]) by cgf.cx (Postfix) with ESMTP id 912046012E; Thu, 8 Aug 2013 01:11:14 -0400 (EDT) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18B4hchy0Lhqsl0/hf3ICCG Date: Thu, 08 Aug 2013 05:11:00 -0000 From: Christopher Faylor To: gdb-patches@sourceware.org, Yao Qi Subject: Re: [PATCH 1/3] Detect GDB is in cygwin Message-ID: <20130808051114.GA1553@ednor.casa.cgf.cx> Mail-Followup-To: gdb-patches@sourceware.org, Yao Qi References: <83txjdxtpd.fsf@gnu.org> <51F786CB.3020700@codesourcery.com> <83a9l4xdst.fsf@gnu.org> <51FA137B.6070207@codesourcery.com> <20130803045452.GA997@ednor.casa.cgf.cx> <51FE1493.9070707@codesourcery.com> <20130805044122.GA1825@ednor.casa.cgf.cx> <51FF4483.5000102@codesourcery.com> <20130806020839.GA3362@ednor.casa.cgf.cx> <520067CB.4000300@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <520067CB.4000300@codesourcery.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-SW-Source: 2013-08/txt/msg00224.txt.bz2 On Tue, Aug 06, 2013 at 11:04:43AM +0800, Yao Qi wrote: >On 08/06/2013 10:08 AM, Christopher Faylor wrote: >> I'm saying that it looks like your code will detect "echo yes | gdb" >> as running on a cygwin pty. > >In this case, the file name of handle looks like >"\cygwin-c5e39b7a9d22bafb-pipe-0xBC0-0x1". It is expected to return >true in this case too, that is to say, we need to set stdout/stderr >unbuffered in this case too. If you're just going to always set to unbuffered when something is a pipe, why not just check for a pipe using GetFileType? Then you don't have to try to use an undocumented Cygwin behaviour. cgf