aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_descrip.c
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2014-11-02 01:13:11 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2014-11-02 01:13:11 +0000
commitd3f3e12a4ff5f64ea6b6d1463bac815f738fc95e (patch)
tree7530bbe6fec41eeac063376ebb76287b1d59ba37 /sys/kern/kern_descrip.c
parent7bd12696d701b3237bedb7a5e9e4f00ca258683d (diff)
downloadsrc-d3f3e12a4ff5f64ea6b6d1463bac815f738fc95e.tar.gz
src-d3f3e12a4ff5f64ea6b6d1463bac815f738fc95e.zip
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 36e58b880830..83a176812acc 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -2160,19 +2160,17 @@ fdcloseexec(struct thread *td)
fdp = td->td_proc->p_fd;
KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared"));
- FILEDESC_XLOCK(fdp);
for (i = 0; i <= fdp->fd_lastfile; i++) {
fde = &fdp->fd_ofiles[i];
fp = fde->fde_file;
if (fp != NULL && (fp->f_type == DTYPE_MQUEUE ||
(fde->fde_flags & UF_EXCLOSE))) {
+ FILEDESC_XLOCK(fdp);
fdfree(fdp, i);
(void) closefp(fdp, i, fp, td, 0);
/* closefp() drops the FILEDESC lock. */
- FILEDESC_XLOCK(fdp);
}
}
- FILEDESC_XUNLOCK(fdp);
}
/*