From: Christopher Faylor <cgf-rcm@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: isatty bug
Date: Tue, 16 Sep 2003 19:37:00 -0000 [thread overview]
Message-ID: <20030916193448.GF23057@redhat.com> (raw)
In-Reply-To: <uekygvbtm.fsf@gnu.org>
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/
next prev parent reply other threads:[~2003-09-16 19:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-15 21:19 Sam Steingold
2003-09-16 10:13 ` Corinna Vinschen
2003-09-16 15:01 ` Sam Steingold
2003-09-16 17:22 ` Christopher Faylor
2003-09-16 17:30 ` Sam Steingold
2003-09-16 17:37 ` Igor Pechtchanski
2003-09-16 18:23 ` Sam Steingold
2003-09-16 18:36 ` Igor Pechtchanski
2003-09-16 19:37 ` Christopher Faylor [this message]
2003-09-16 19:01 Brian Ford
2003-09-16 19:02 ` Sam Steingold
2003-09-16 19:34 Brian Ford
2003-09-16 20:28 ` Sam Steingold
2003-09-16 21:01 Brian Ford
2003-09-16 22:05 ` Christopher Faylor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030916193448.GF23057@redhat.com \
--to=cgf-rcm@cygwin.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).