summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>2004-08-16 03:09:01 +0000
committergreen <green@FreeBSD.org>2004-08-16 03:09:01 +0000
commit1de6d6df05dc75c48597f345ef9a8372bc906d67 (patch)
tree0081263f4940b2b8452503966e784bdcffbef9f6 /sys
parent99deda206a35ed06d1d8fef339557383b8220880 (diff)
downloadFreeBSD-src-1de6d6df05dc75c48597f345ef9a8372bc906d67.zip
FreeBSD-src-1de6d6df05dc75c48597f345ef9a8372bc906d67.tar.gz
Add the missing knote_fdclose().
Diffstat (limited to 'sys')
-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