public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* debug script.c - PTY question
@ 2001-07-21 21:12 Perry Dykes
  0 siblings, 0 replies; only message in thread
From: Perry Dykes @ 2001-07-21 21:12 UTC (permalink / raw)
  To: cygwin

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/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-07-21 21:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-21 21:12 debug script.c - PTY question Perry Dykes

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).