diff -urp libc.org/stdio/findfp.c libc/stdio/findfp.c --- libc.org/stdio/findfp.c 2004-01-16 15:16:26.623452800 +0100 +++ libc/stdio/findfp.c 2004-01-16 15:18:14.027892800 +0100 @@ -114,9 +114,6 @@ found: fp->_ub._size = 0; fp->_lb._base = NULL; /* no line buffer */ fp->_lb._size = 0; -#ifndef __SINGLE_THREAD__ - memset (&fp->_lock, 0, sizeof(fp->_lock)); -#endif return fp; } diff -urp libc.org/stdio/vfprintf.c libc/stdio/vfprintf.c --- libc.org/stdio/vfprintf.c 2004-01-16 15:16:54.233153600 +0100 +++ libc/stdio/vfprintf.c 2004-01-16 15:23:30.352745600 +0100 @@ -253,7 +253,7 @@ __sbprintf(fp, fmt, ap) fake._bf._size = fake._w = sizeof(buf); fake._lbfsize = 0; /* not actually used, but Just In Case */ #ifndef __SINGLE_THREAD__ - memset (&fake._lock, 0, sizeof(fake._lock)); + __lock_init_recursive (*(_LOCK_RECURSIVE_T *)&fake._lock); #endif /* do the work, then copy any error status */ @@ -262,6 +262,10 @@ __sbprintf(fp, fmt, ap) ret = EOF; if (fake._flags & __SERR) fp->_flags |= __SERR; + +#ifndef __SINGLE_THREAD__ + __lock_close_recursive (*(_LOCK_RECURSIVE_T *)&fake._lock); +#endif return (ret); }