2004-01-16 Thomas Pfaff <tpfaff@gmx.net>

* libc/stdio/findfp.c (__sfp): Remove unnecessary memset.
        * libc/stdio/vfprintf.c (__sbprintf): Ditto.
        Add calls to __lock_init_recursive and __lock_close_recursive
        instead.
This commit is contained in:
Jeff Johnston 2004-01-16 19:29:16 +00:00
parent 8e7014383b
commit 4af71a917c
3 changed files with 12 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2004-01-16 Thomas Pfaff <tpfaff@gmx.net>
* libc/stdio/findfp.c (__sfp): Remove unnecessary memset.
* libc/stdio/vfprintf.c (__sbprintf): Ditto.
Add calls to __lock_init_recursive and __lock_close_recursive
instead.
2004-01-15 Thomas Pfaff <tpfaff@gmx.net> 2004-01-15 Thomas Pfaff <tpfaff@gmx.net>
* libc/stdio/fclose.c: Include sys/lock.h. * libc/stdio/fclose.c: Include sys/lock.h.

View File

@ -114,9 +114,6 @@ found:
fp->_ub._size = 0; fp->_ub._size = 0;
fp->_lb._base = NULL; /* no line buffer */ fp->_lb._base = NULL; /* no line buffer */
fp->_lb._size = 0; fp->_lb._size = 0;
#ifndef __SINGLE_THREAD__
memset (&fp->_lock, 0, sizeof(fp->_lock));
#endif
return fp; return fp;
} }

View File

@ -253,7 +253,7 @@ __sbprintf(fp, fmt, ap)
fake._bf._size = fake._w = sizeof(buf); fake._bf._size = fake._w = sizeof(buf);
fake._lbfsize = 0; /* not actually used, but Just In Case */ fake._lbfsize = 0; /* not actually used, but Just In Case */
#ifndef __SINGLE_THREAD__ #ifndef __SINGLE_THREAD__
memset (&fake._lock, 0, sizeof(fake._lock)); __lock_init_recursive (*(_LOCK_RECURSIVE_T *)&fake._lock);
#endif #endif
/* do the work, then copy any error status */ /* do the work, then copy any error status */
@ -262,6 +262,10 @@ __sbprintf(fp, fmt, ap)
ret = EOF; ret = EOF;
if (fake._flags & __SERR) if (fake._flags & __SERR)
fp->_flags |= __SERR; fp->_flags |= __SERR;
#ifndef __SINGLE_THREAD__
__lock_close_recursive (*(_LOCK_RECURSIVE_T *)&fake._lock);
#endif
return (ret); return (ret);
} }