Mail Archives: cygwin/2001/07/22/00:13:09
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 -