Re: [PATCH] FD array expansion problem

Alan Cox (alan@lxorguk.ukuu.org.uk)
Sat, 30 Oct 1999 18:53:41 +0100 (BST)


> I did the backport to 2.2.13:
>
> if (nr >= files->max_fds) {
> expand = 1;
> - if ((err = expand_fd_array(files, nr)))
> + if ((err = expand_fd_array(files, nr + 1)))
> goto out;

I think this is not the cleanest fix. The problem is fixed more cleanly in
expand_fdset by making it nr >= NR_OPEN and the loop termination use

nfds <= nr

Its then much more obvious what is going on

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/