summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Long <scottl@FreeBSD.org>2003-02-24 05:46:55 +0000
committerScott Long <scottl@FreeBSD.org>2003-02-24 05:46:55 +0000
commit3303c14b570bc960495ca74a7aeac2922f121e2e (patch)
tree04338b900c35ac57ccc0bcae41990cbcd45a4d96
parentb9a49f7eb432e420dd2631c8b640acb02d3d84a5 (diff)
Notes
-rw-r--r--sys/kern/kern_descrip.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 62d73483dfcb..25f9f4664a48 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -1411,10 +1411,6 @@ fdfree(td)
if (fdp == NULL)
return;
- mtx_lock(&fdesc_mtx);
- td->td_proc->p_fd = NULL;
- mtx_unlock(&fdesc_mtx);
-
FILEDESC_LOCK(fdp);
if (--fdp->fd_refcnt > 0) {
FILEDESC_UNLOCK(fdp);
@@ -1431,6 +1427,12 @@ fdfree(td)
if (*fpp)
(void) closef(*fpp, td);
}
+
+ /* XXX This should happen earlier. */
+ mtx_lock(&fdesc_mtx);
+ td->td_proc->p_fd = NULL;
+ mtx_unlock(&fdesc_mtx);
+
if (fdp->fd_nfiles > NDFILE)
FREE(fdp->fd_ofiles, M_FILEDESC);
if (fdp->fd_cdir)