}
}
- if (type == -1) return(EBADF);
+ if (type == -1) {
+ select_cancel_all(se);
+ return(EBADF);
+ }
se->type[fd] = type;
/* Test filp for select operations if not already done so. e.g., files
*/
r = copy_fdsets(se, se->nfds, TO_PROC);
select_cancel_all(se);
- se->requestor = NULL;
if (r != OK) return(r);
else return(se->nreadyfds);
return(SEL_DEFERRED);
}
-
/*===========================================================================*
* select_major_match *
*===========================================================================*/
{
int fd;
+ e->requestor = NULL;
for(fd = 0; fd < e->nfds; fd++) {
struct filp *fp;
fp = e->filps[fd];
select_cancel_all(se);
copy_fdsets(se, se->nfds, TO_PROC); /* FIXME, return error status */
select_wakeup(se, r ? r : se->nreadyfds);
- se->requestor = NULL;
}
}
select_cancel_all(&selecttab[s]);
- selecttab[s].requestor = NULL;
return;
}
se->deferred= FALSE;
}
if (se->nreadyfds > 0 || !se->block) {
- copy_fdsets(se, se->nfds, TO_PROC); /* FIXME, return error */
- select_wakeup(se, se->nreadyfds);
- se->requestor = NULL;
+ select_return(se, 0);
}
}