Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Tue, 16 Sep 2003 15:34:48 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: isatty bug Message-ID: <20030916193448.GF23057@redhat.com> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20030916100108 DOT GO9981 AT cygbert DOT vinschen DOT de> <20030916171951 DOT GA21860 AT redhat DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i On Tue, Sep 16, 2003 at 02:16:05PM -0400, Sam Steingold wrote: >what about this: > >int same_tty_p (int fd1, int fd2) >{ > struct stat stat1; > struct stat stat2; > return ((fstat(fd1,&stat1) >= 0) && (fstat(fd2,&stat2) >= 0) && > (stat1.st_dev == stat2.st_dev) && (stat2.st_ino == stat2.st_ino)); >} > > > printf("0/1: %d\n1/2: %d\n2/0: %d\n",same_tty_p(0,1), > same_tty_p(1,2),same_tty_p(2,0)); > > >I get crash both in program and gdb (i.e., gdb itself segfaults) on the >fstat() calls. Is it really that hard to produce working test cases that compile out of the box? Anyway, after adding a main and some include files the above, unsurprisingly, works fine. 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/