In fdalloc() f_ofileflags for the newly allocated descriptor has to be 0.

Assert that instead of setting it to 0.

Sponsored by:	FreeBSD Foundation
MFC after:	1 month
This commit is contained in:
Pawel Jakub Dawidek 2012-06-07 23:33:10 +00:00
parent d3644b04ca
commit bf3e37ef15
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=236731

View File

@ -1554,9 +1554,8 @@ fdalloc(struct thread *td, int minfd, int *result)
*/
KASSERT(!fdisused(fdp, fd),
("fd_first_free() returned non-free descriptor"));
KASSERT(fdp->fd_ofiles[fd] == NULL,
("free descriptor isn't"));
fdp->fd_ofileflags[fd] = 0; /* XXX needed? */
KASSERT(fdp->fd_ofiles[fd] == NULL, ("free descriptor isn't"));
KASSERT(fdp->fd_ofileflags[fd] == 0, ("file flags are set"));
fdused(fdp, fd);
*result = fd;
return (0);