summaryrefslogtreecommitdiff
path: root/sys/kern/kern_descrip.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2018-05-08 09:03:59 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2018-05-08 09:03:59 +0000
commit6faf5e04ac771ee419ade4d3426a8fb812669559 (patch)
treeb365a8fcfdacd5512f09a709b5c92b1a43916bea /sys/kern/kern_descrip.c
parent7a3f425a437bf72f0ce1279c83be4acd0c57d50a (diff)
Change fd_iterfile() to not return imature fps instead of skipping them
later. ok bluhm@, visa@
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r--sys/kern/kern_descrip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index fc971435284..1d0e4b73edf 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_descrip.c,v 1.157 2018/05/08 08:53:41 mpi Exp $ */
+/* $OpenBSD: kern_descrip.c,v 1.158 2018/05/08 09:03:58 mpi Exp $ */
/* $NetBSD: kern_descrip.c,v 1.42 1996/03/30 22:24:38 christos Exp $ */
/*
@@ -190,7 +190,7 @@ fd_iterfile(struct file *fp, struct proc *p)
nfp = LIST_NEXT(fp, f_list);
/* don't FREF when f_count == 0 to avoid race in fdrop() */
- while (nfp != NULL && nfp->f_count == 0)
+ while (nfp != NULL && (nfp->f_count == 0 || !FILE_IS_USABLE(nfp)))
nfp = LIST_NEXT(nfp, f_list);
if (nfp != NULL)
FREF(nfp);