filedesc: return 0 from badfo_close

The only potential in-tree consumer (_fdrop) special-cased it and returns 0
0 on its own instead of calling badfo_close.

Remove the special case since it is not needed and very unlikely to encounter
anyway.

No objections from:	kib
This commit is contained in:
Mateusz Guzik 2015-01-21 18:05:42 +00:00
parent 5751146497
commit f9051b0e02
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=277495

View File

@ -2680,11 +2680,9 @@ _fdrop(struct file *fp, struct thread *td)
{
int error;
error = 0;
if (fp->f_count != 0)
panic("fdrop: count %d", fp->f_count);
if (fp->f_ops != &badfileops)
error = fo_close(fp, td);
error = fo_close(fp, td);
atomic_subtract_int(&openfiles, 1);
crfree(fp->f_cred);
free(fp->f_advice, M_FADVISE);
@ -3664,7 +3662,7 @@ static int
badfo_close(struct file *fp, struct thread *td)
{
return (EBADF);
return (0);
}
static int