Add a comment to explain what fdclose() does and what it's purpose is

since the subtlety eluded me when I looked at it last week.
This commit is contained in:
John Baldwin 2006-07-21 20:24:00 +00:00
parent b4c63329d5
commit b04aff773e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=160556

View File

@ -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)
{