=================================================================== RCS file: /home/cvs/OpenXM_contrib2/fep/fep_main.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -p -r1.1 -r1.2 --- OpenXM_contrib2/fep/fep_main.c 2002/09/03 00:41:44 1.1 +++ OpenXM_contrib2/fep/fep_main.c 2002/09/09 12:11:51 1.2 @@ -2,7 +2,7 @@ #ifndef lint static char rcsid[]= -"$Id: fep_main.c,v 1.1 2002/09/03 00:41:44 noro Exp $ (SRA)"; +"$Id: fep_main.c,v 1.2 2002/09/09 12:11:51 noro Exp $ (SRA)"; #endif /* lint */ #include @@ -839,11 +839,13 @@ get_pty_master() return; } #ifdef __CYGWIN32__ - for (i = 0; i < 16; i++) { - sprintf (master_tty, "/dev/ptmx"); - master = open (master_tty, O_RDWR); - if (master >= 0) { - sprintf (slave_tty, "/dev/tty%x",i); + sprintf (master_tty, "/dev/ptmx"); + master = open (master_tty, O_RDWR); + if (master >= 0) { + char *name; + name = (char *)ptsname(master); + if ( name != 0 ) { + strcpy(slave_tty, name); goto FOUND; } }