summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_descrip.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 5104999..59a96b7 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -684,7 +684,6 @@ do_dup(td, type, old, new, retval)
fdp->fd_ofileflags[new] = fdp->fd_ofileflags[old] &~ UF_EXCLOSE;
if (new > fdp->fd_lastfile)
fdp->fd_lastfile = new;
- FILEDESC_UNLOCK(fdp);
*retval = new;
/*
@@ -695,7 +694,8 @@ do_dup(td, type, old, new, retval)
* XXX this duplicates parts of close().
*/
if (delfp != NULL) {
- /* XXX need to call knote_fdclose() */
+ knote_fdclose(td, new);
+ FILEDESC_UNLOCK(fdp);
mtx_lock(&Giant);
(void) closef(delfp, td);
mtx_unlock(&Giant);
@@ -709,6 +709,8 @@ do_dup(td, type, old, new, retval)
}
FILEDESC_UNLOCK(fdp);
}
+ } else {
+ FILEDESC_UNLOCK(fdp);
}
return (0);
}
OpenPOWER on IntegriCloud