summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/fwalk.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdio/fwalk.c')
-rw-r--r--lib/libc/stdio/fwalk.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libc/stdio/fwalk.c b/lib/libc/stdio/fwalk.c
index 17cb5ce..b943be4 100644
--- a/lib/libc/stdio/fwalk.c
+++ b/lib/libc/stdio/fwalk.c
@@ -61,10 +61,13 @@ _fwalk(function)
* It should be safe to walk the list without locking it;
* new nodes are only added to the end and none are ever
* removed.
+ *
+ * Avoid locking this list while walking it or else you will
+ * introduce a potential deadlock in [at least] refill.c.
*/
for (g = &__sglue; g != NULL; g = g->next)
for (fp = g->iobs, n = g->niobs; --n >= 0; fp++)
- if (fp->_flags != 0)
+ if ((fp->_flags != 0) && ((fp->_flags & __SIGN) == 0))
ret |= (*function)(fp);
return (ret);
}
OpenPOWER on IntegriCloud