[Guardsoft-cvs] guard/src/client main.c,1.31,1.32
Brought to you by:
jarrah
|
From: Greg W. <ja...@us...> - 2005-05-23 22:29:41
|
Update of /cvsroot/guardsoft/guard/src/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9182 Modified Files: main.c Log Message: hack for apple weirness Index: main.c =================================================================== RCS file: /cvsroot/guardsoft/guard/src/client/main.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** main.c 7 Jan 2004 02:29:47 -0000 1.31 --- main.c 23 May 2005 22:29:32 -0000 1.32 *************** *** 738,741 **** --- 738,744 ---- Query(invoke_proc_t *p, int prom, char *s) { + #ifdef __APPLE__ + fd_set fin; + #endif /* __APPLE__*/ char buf[10]; *************** *** 748,754 **** fflush(stdout); if ( ! fgets(buf, 10, stdin) == NULL || *buf == 'n' --- 751,767 ---- fflush(stdout); + #ifdef __APPLE__ + /* + ** For some reason stdin gets set to O_NONBLOCK so + ** we must wait on the file descriptor ?!?! + */ + FD_ZERO(&fin); + FD_SET(0, &fin); + select(1, &fin, NULL, NULL, NULL); + #endif /* __APPLE__*/ + if ( ! fgets(buf, 10, stdin) == NULL || *buf == 'n' |