summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_descrip.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r--sys/kern/kern_descrip.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 599e917..c3e659a 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -1756,6 +1756,14 @@ setugidsafety(struct thread *td)
FILEDESC_UNLOCK(fdp);
}
+/*
+ * If a specific file object occupies a specific file descriptor,
+ * close the file descriptor entry and drop a reference on the file
+ * object. This is a convenience function to handle a subsequent
+ * error in a function that calls falloc() that handles the race that
+ * another thread might have closed the file descriptor out from under
+ * the thread creating the file object.
+ */
void
fdclose(struct filedesc *fdp, struct file *fp, int idx, struct thread *td)
{
OpenPOWER on IntegriCloud