[comp.bugs.2bsd] V1.8

bostic@OKEEFFE.BERKELEY.EDU (Keith Bostic) (10/18/87)

Subject: selscan routine is wrong
Index: sys/sys_generic.c 2.10BSD

Description:
	The selscan routine works erratically, at best, if UCB_NET
	is defined.
Repeat-By:
	Use the select(2) call.
Fix:
	Apply the following patch to sys_generic.c.

*** sys_generic.c.old	Sat Oct 17 15:56:15 1987
--- sys_generic.c	Sat Oct 17 16:14:29 1987
***************
*** 326,338 ****
  	int flag;
  	struct file *fp;
  	int n = 0;
! 	int (*selroutine)();
! 
  #ifdef UCB_NET
! 	int soo_select(), ino_select();
! 	selroutine = (fp->f_type == DTYPE_SOCKET) ? soo_select : ino_select;
  #else
- 	int ino_select();
  	selroutine = ino_select;
  #endif
  	for (which = 0; which < 3; which++) {
--- 326,335 ----
  	int flag;
  	struct file *fp;
  	int n = 0;
! 	int (*selroutine)(), ino_select();
  #ifdef UCB_NET
! 	int soo_select();
  #else
  	selroutine = ino_select;
  #endif
  	for (which = 0; which < 3; which++) {
***************
*** 356,361 ****
--- 353,361 ----
  					u.u_error = EBADF;
  					break;
  				}
+ #ifdef UCB_NET
+ 				selroutine = (fp->f_type == DTYPE_SOCKET) ? soo_select : ino_select;
+ #endif
  				if ((*selroutine)(fp, flag)) {
  					FD_SET(i + j, &obits[which]);
  					n++;