From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8264 invoked by alias); 29 Jul 2013 15:42:19 -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 8255 invoked by uid 89); 29 Jul 2013 15:42:19 -0000 X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_40,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,RDNS_NONE,SPF_SOFTFAIL autolearn=no version=3.3.1 Received: from Unknown (HELO mtaout20.012.net.il) (80.179.55.166) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 29 Jul 2013 15:42:18 +0000 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MQP00100FLYN600@a-mtaout20.012.net.il> for gdb-patches@sourceware.org; Mon, 29 Jul 2013 18:42:09 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MQP000V4FM8ZVB0@a-mtaout20.012.net.il>; Mon, 29 Jul 2013 18:42:09 +0300 (IDT) Date: Mon, 29 Jul 2013 15:42:00 -0000 From: Eli Zaretskii Subject: Re: [PATCH 2/3] Unbuffer stdout and stderr in cygwin In-reply-to: <1375087546-22591-3-git-send-email-yao@codesourcery.com> To: Yao Qi Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83siyxxtif.fsf@gnu.org> References: <1375087546-22591-1-git-send-email-yao@codesourcery.com> <1375087546-22591-3-git-send-email-yao@codesourcery.com> X-SW-Source: 2013-07/txt/msg00706.txt.bz2 > From: Yao Qi > Date: Mon, 29 Jul 2013 16:45:45 +0800 > > +#ifdef __MINGW32__ > + if (is_in_cygwin_p ()) I would suggest to call the function using_cygwin_pty or some such. "is_in_cygwin" is IMO too ambiguous. > + setvbuf (stdout, NULL, _IONBF, BUFSIZ); > + setvbuf (stderr, NULL, _IONBF, BUFSIZ); How about using line buffering instead on both streams? Or at least leave stdout line-buffered? Did you try that, and if so, did that have the same problems that triggered these patches? You see, the way your patch works, using GDB from a Cygwin shell window will always do the above, even when not running the test suite. Users might be unhappy that their standard output suddenly becomes much less efficient.