This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: isatty bug
> * Christopher Faylor <pts-epz@pltjva.pbz> [2003-09-16 13:19:51 -0400]:
>
> On Tue, Sep 16, 2003 at 10:42:49AM -0400, Sam Steingold wrote:
> >>* Corinna Vinschen <pbevaan-pltjva@pltjva.pbz> [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 <stdio.h>
> >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.
what is the "obvious typo"?
--
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
((lambda (x) `(,x ',x)) '(lambda (x) `(,x ',x)))
--
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/