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:
parent
b4c63329d5
commit
b04aff773e
@ -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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user