fwalk.c (71579) | fwalk.c (72373) |
---|---|
1/*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Chris Torek. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 25 unchanged lines hidden (view full) --- 34 * SUCH DAMAGE. 35 */ 36 37#if defined(LIBC_SCCS) && !defined(lint) 38#if 0 39static char sccsid[] = "@(#)fwalk.c 8.1 (Berkeley) 6/4/93"; 40#endif 41static const char rcsid[] = | 1/*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Chris Torek. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 25 unchanged lines hidden (view full) --- 34 * SUCH DAMAGE. 35 */ 36 37#if defined(LIBC_SCCS) && !defined(lint) 38#if 0 39static char sccsid[] = "@(#)fwalk.c 8.1 (Berkeley) 6/4/93"; 40#endif 41static const char rcsid[] = |
42 "$FreeBSD: head/lib/libc/stdio/fwalk.c 71579 2001-01-24 13:01:12Z deischen $"; | 42 "$FreeBSD: head/lib/libc/stdio/fwalk.c 72373 2001-02-11 22:06:43Z deischen $"; |
43#endif /* LIBC_SCCS and not lint */ 44 45#include <sys/types.h> 46#include <machine/atomic.h> 47#include <stdio.h> 48#include "local.h" 49#include "glue.h" 50 --- 5 unchanged lines hidden (view full) --- 56 int n, ret; 57 struct glue *g; 58 59 ret = 0; 60 /* 61 * It should be safe to walk the list without locking it; 62 * new nodes are only added to the end and none are ever 63 * removed. | 43#endif /* LIBC_SCCS and not lint */ 44 45#include <sys/types.h> 46#include <machine/atomic.h> 47#include <stdio.h> 48#include "local.h" 49#include "glue.h" 50 --- 5 unchanged lines hidden (view full) --- 56 int n, ret; 57 struct glue *g; 58 59 ret = 0; 60 /* 61 * It should be safe to walk the list without locking it; 62 * new nodes are only added to the end and none are ever 63 * removed. |
64 * 65 * Avoid locking this list while walking it or else you will 66 * introduce a potential deadlock in [at least] refill.c. |
|
64 */ 65 for (g = &__sglue; g != NULL; g = g->next) 66 for (fp = g->iobs, n = g->niobs; --n >= 0; fp++) | 67 */ 68 for (g = &__sglue; g != NULL; g = g->next) 69 for (fp = g->iobs, n = g->niobs; --n >= 0; fp++) |
67 if (fp->_flags != 0) | 70 if ((fp->_flags != 0) && ((fp->_flags & __SIGN) == 0)) |
68 ret |= (*function)(fp); 69 return (ret); 70} | 71 ret |= (*function)(fp); 72 return (ret); 73} |