delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/09/16/15:35:27

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
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 <cgf-rcm AT cygwin DOT com>
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: <usmmxyckr DOT fsf AT gnu DOT org> <20030916100108 DOT GO9981 AT cygbert DOT vinschen DOT de> <uwuc8x09i DOT fsf AT gnu DOT org> <20030916171951 DOT GA21860 AT redhat DOT com> <upti0vdxo DOT fsf AT gnu DOT org> <Pine DOT GSO DOT 4 DOT 56 DOT 0309161332390 DOT 12411 AT slinky DOT cs DOT nyu DOT edu> <uekygvbtm DOT fsf AT gnu DOT org>
Mime-Version: 1.0
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019