From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1042 invoked by alias); 16 Sep 2003 17:19:56 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 1031 invoked from network); 16 Sep 2003 17:19:55 -0000 Received: from unknown (HELO redhat.com) (66.187.230.200) by sources.redhat.com with SMTP; 16 Sep 2003 17:19:55 -0000 Received: by redhat.com (Postfix, from userid 201) id 61AA86C6DE; Tue, 16 Sep 2003 13:19:51 -0400 (EDT) Date: Tue, 16 Sep 2003 17:22:00 -0000 From: Christopher Faylor To: cygwin@cygwin.com Subject: Re: isatty bug Message-ID: <20030916171951.GA21860@redhat.com> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20030916100108.GO9981@cygbert.vinschen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-SW-Source: 2003-09/txt/msg01046.txt.bz2 On Tue, Sep 16, 2003 at 10:42:49AM -0400, Sam Steingold wrote: >>* Corinna Vinschen [2003-09-16 12:01:08 +0200]: >> >> On Mon, Sep 15, 2003 at 05:19:16PM -0400, Sam Steingold wrote: >> > calling isatty(0) in a program results in a segfault: >> And the version number of the DLL is ... > >1.5.4(0.94/3/2) > >> Fd 0 is a tty, a console window, a tape drive, a ... > >I am doing this in a windows console, as created by clicking on the >cygwin icon, i.e., in the bash shell. >I assume that 0 means stdin. > >> Reproducible testcase is ... > >------- scratch.c ---- >#include >int main (void) { >#define Y_N(x) ((x) ? "(TTY)" : "(not a TTY)") > printf("0: %s %s\n1: %s %s\n2: %s %s\n", > ttyname(0),Y_N(isatty(0)),ttyname(1),Y_N(isatty(1)), > ttyname(2),Y_N(isatty(2))) >#undef Y_N > return 0; >} >------- scratch.c ---- Fixing the obvious typo in the above provides the desired results both inside gdb and outside gdb. With CYGWIN=tty and with CYGWIN=notty. So, I can't duplicate this problem. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/