diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2004-01-30 20:32:04 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2004-01-30 20:32:04 +0000 |
commit | ff41498a1931f86da1089e8d0bb88dc4f3973273 (patch) | |
tree | 5c7e9b7b35d1899ddea4450aa4f7561c1ca27271 /newlib | |
parent | 1a4f1aef1fd1f58e2f40fc74c57d005cf19d7cc4 (diff) | |
download | newlib-ff41498a1931f86da1089e8d0bb88dc4f3973273.zip newlib-ff41498a1931f86da1089e8d0bb88dc4f3973273.tar.gz newlib-ff41498a1931f86da1089e8d0bb88dc4f3973273.tar.bz2 |
2004-01-30 Thomas Pfaff <tpfaff@gmx.net>
Jeff Johnston <jjohnstn@redhat.com>
* libc/stdio/fwalk.c (_fwalk): Traverse the given reentrancy
struct for std streams and traverse the global reeentrancy
struct for all other streams.
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/ChangeLog | 7 | ||||
-rw-r--r-- | newlib/libc/stdio/fwalk.c | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 5757512..7ea7d15 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,10 @@ +2004-01-30 Thomas Pfaff <tpfaff@gmx.net> + Jeff Johnston <jjohnstn@redhat.com> + + * libc/stdio/fwalk.c (_fwalk): Traverse the given reentrancy + struct for std streams and traverse the global reeentrancy + struct for all other streams. + 2004-01-27 Jeff Johnston <jjohnstn@redhat.com> * libc/stdlib/atexit.c: Protect global atexit list with a diff --git a/newlib/libc/stdio/fwalk.c b/newlib/libc/stdio/fwalk.c index 5162834..4d37499 100644 --- a/newlib/libc/stdio/fwalk.c +++ b/newlib/libc/stdio/fwalk.c @@ -35,9 +35,17 @@ _fwalk (ptr, function) register int n, ret = 0; register struct _glue *g; + /* Must traverse given list for std streams. */ for (g = &ptr->__sglue; g != NULL; g = g->_next) for (fp = g->_iobs, n = g->_niobs; --n >= 0; fp++) if (fp->_flags != 0) ret |= (*function) (fp); + + /* Must traverse global list for all other streams. */ + for (g = &_GLOBAL_REENT->__sglue; g != NULL; g = g->_next) + for (fp = g->_iobs, n = g->_niobs; --n >= 0; fp++) + if (fp->_flags != 0) + ret |= (*function) (fp); + return ret; } |