From 6a150987938abfef78f72d0bf4ed6b427b25e040 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Thu, 15 Jan 2004 19:12:17 +0000 Subject: 2004-01-15 Thomas Pfaff * libc/stdio/fclose.c: Include sys/lock.h. (fclose): Destroy lock when file is closed. * libc/stdio/findfp.c (__sfp): Initialize file pointers _lock member. * libc/stdio/freopen.c: Include sys/lock.h. (_freopen_r): Destroy lock when file is closed. * libc/stdio/vfprintf.c (__sbprintf): Initialize file pointers _lock member. --- newlib/libc/stdio/vfprintf.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'newlib/libc/stdio/vfprintf.c') diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c index 7015740e0..c13a7f70f 100644 --- a/newlib/libc/stdio/vfprintf.c +++ b/newlib/libc/stdio/vfprintf.c @@ -252,6 +252,9 @@ __sbprintf(fp, fmt, ap) fake._bf._base = fake._p = buf; 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)); +#endif /* do the work, then copy any error status */ ret = VFPRINTF(&fake, fmt, ap); -- cgit v1.2.3