This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] _fwalk walks through thread local FILE pointer


This isn't right.  You are passed a REENT pointer and cannot
simply ignore it.

This will break any code that depends upon the existing
behavior.  In RTEMS, we use _fwalk as it exists to
implement sync() and walk each thread's open files.
It is also used as part of the per-thread cleanup
dynamically.

If you want to have NULL ptr argument imply the global
reent, great but don't break it.

--joel

Thomas Pfaff wrote:

instead of global file pointer list.

Thomas

2004-01-28 Thomas Pfaff <tpfaff.gmx.net>

    * libc/stdio/fwalk.c (_fwalk): Walk through global file
    pointer list instead of thread lokal.


------------------------------------------------------------------------


--- fwalk.c.org 2000-05-14 18:46:11.000000000 +0200
+++ fwalk.c 2004-01-28 10:01:03.646001600 +0100
@@ -35,7 +35,7 @@ _fwalk (ptr, function)
register int n, ret = 0;
register struct _glue *g;
- for (g = &ptr->__sglue; g != NULL; g = g->_next)
+ 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);



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]