=================================================================== RCS file: /home/cvs/OpenXM_contrib2/fep/fep_main.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -p -r1.9 -r1.10 --- OpenXM_contrib2/fep/fep_main.c 2012/05/14 12:52:08 1.9 +++ OpenXM_contrib2/fep/fep_main.c 2017/10/02 06:46:11 1.10 @@ -2,7 +2,7 @@ #ifndef lint static char rcsid[]= -"$Id: fep_main.c,v 1.9 2012/05/14 12:52:08 ohara Exp $ (SRA)"; +"$Id: fep_main.c,v 1.10 2017/10/02 06:46:11 noro Exp $ (SRA)"; #endif /* lint */ #include @@ -868,7 +868,7 @@ get_pty_master() master = 1; return; } -#if defined(__CYGWIN32__) || defined(__linux__) +#if defined(__CYGWIN32__) || defined(__linux__) || defined(__APPLE__) sprintf (master_tty, "/dev/ptmx"); master = open (master_tty, O_RDWR); if (master >= 0) { @@ -877,6 +877,14 @@ get_pty_master() grantpt(master); unlockpt(master); if ( !ptsname_r(master,name,sizeof(name)) ) { + strcpy(slave_tty, name); + goto FOUND; + } +#elif defined(__APPLE__) + char *name; + grantpt(master); + unlockpt(master); + if ( name = (char *)ptsname(master) ) { strcpy(slave_tty, name); goto FOUND; }