summaryrefslogtreecommitdiff
path: root/sys/kern/kern_descrip.c
diff options
context:
space:
mode:
authorChristian S.J. Peron <csjp@FreeBSD.org>2006-03-18 23:27:21 +0000
committerChristian S.J. Peron <csjp@FreeBSD.org>2006-03-18 23:27:21 +0000
commit30bacc08e0ae21c1721282e3541f8f3e22d88db2 (patch)
tree139432e83112eeb7680ca565ad304149ccfc22b8 /sys/kern/kern_descrip.c
parent5740a2b62d4cff6a434d2ec5c250e492215d5402 (diff)
Notes
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r--sys/kern/kern_descrip.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index f84d348dea240..56ab05ae90a2c 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -1257,9 +1257,6 @@ fdalloc(struct thread *td, int minfd, int *result)
FILEDESC_LOCK_ASSERT(fdp, MA_OWNED);
- if (fdp->fd_freefile > minfd)
- minfd = fdp->fd_freefile;
-
PROC_LOCK(p);
maxfd = min((int)lim_cur(p, RLIMIT_NOFILE), maxfilesperproc);
PROC_UNLOCK(p);
@@ -1289,6 +1286,7 @@ fdalloc(struct thread *td, int minfd, int *result)
("free descriptor isn't"));
fdp->fd_ofileflags[fd] = 0; /* XXX needed? */
fdused(fdp, fd);
+ fdp->fd_freefile = fd_first_free(fdp, fd, fdp->fd_nfiles);
*result = fd;
return (0);
}