diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-06-17 13:25:08 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-06-17 13:25:08 +0000 |
commit | 59223edaa18759982db0a8aced0e77457d10c68e (patch) | |
tree | 89354903b01fa0a447bffeefe00df3044495db2e /fs/select.c | |
parent | db7d4daea91e105e3859cf461d7e53b9b77454b2 (diff) |
Merge with Linux 2.3.6. Sorry, this isn't tested on silicon, I don't
have a MIPS box at hand.
Diffstat (limited to 'fs/select.c')
-rw-r--r-- | fs/select.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/select.c b/fs/select.c index a89425503..e47e3b0b4 100644 --- a/fs/select.c +++ b/fs/select.c @@ -58,7 +58,7 @@ static void free_wait(poll_table * p) } } -void __pollwait(struct file * filp, struct wait_queue ** wait_address, poll_table *p) +void __pollwait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p) { for (;;) { if (p->nr < __MAX_POLL_TABLE_ENTRIES) { @@ -68,8 +68,7 @@ ok_table: entry->filp = filp; filp->f_count++; entry->wait_address = wait_address; - entry->wait.task = current; - entry->wait.next = NULL; + init_waitqueue_entry(&entry->wait, current); add_wait_queue(wait_address,&entry->wait); p->nr++; return; @@ -268,8 +267,12 @@ sys_select(int n, fd_set *inp, fd_set *outp, fd_set *exp, struct timeval *tvp) } ret = -EINVAL; - if (n < 0 || n > KFDS_NR) + if (n < 0) goto out_nofds; + + if (n > KFDS_NR) + n = KFDS_NR; + /* * We need 6 bitmaps (in/out/ex for both incoming and outgoing), * since we used fdset we need to allocate memory in units of |