Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Tue, 16 Sep 2003 15:34:48 -0400
From: Christopher Faylor <cgf-rcm@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: isatty bug
Message-ID: <20030916193448.GF23057@redhat.com>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <usmmxyckr.fsf@gnu.org> <20030916100108.GO9981@cygbert.vinschen.de> <uwuc8x09i.fsf@gnu.org> <20030916171951.GA21860@redhat.com> <upti0vdxo.fsf@gnu.org> <Pine.GSO.4.56.0309161332390.12411@slinky.cs.nyu.edu> <uekygvbtm.fsf@gnu.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <uekygvbtm.fsf@gnu.org>
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/

