delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/07/22/00:13:09

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3B5A5389.AE565739@lakes.com>
Date: Sat, 21 Jul 2001 23:16:09 -0500
From: Perry Dykes <pdykes AT lakes DOT com>
X-Mailer: Mozilla 4.76 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: debug script.c - PTY question

Have a utility script.c compiling now, which enables the script unix
utility. But need some cygwin help. I have compiled without the ifdef
HAVE_openpty set. So the code, calls getmaster() and skips to 339
(verified in debugger).

On line 346, during first test sequence none of the ptys are found. Can
someone point me to a cygwin pty howto? Are folks supposed to create
them, and if so, what command would be used to make this code function
correctly?

 330 getmaster() {
  331 #ifdef HAVE_openpty
  332  (void) tcgetattr(0, &tt);
  333  (void) ioctl(0, TIOCGWINSZ, (char *)&win);
  334  if (openpty(&master, &slave, NULL, &tt, &win) < 0) {
  335   fprintf(stderr, _("openpty failed\n"));
  336   fail();
  337  }
  338 #else
- 339  char *pty, *bank, *cp;
  340  struct stat stb;
  341
- 342  pty = &line[strlen("/dev/ptyp")];
- 343  for (bank = "pqrs"; *bank; bank++) {
- 344   line[strlen("/dev/pty")] = *bank;
- 345   *pty = '0';
- 346   if (stat(line, &stb) < 0)  ****FAILS****, Utility Exits
- 347    break;

Thanks,
Perry


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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