summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdio/vfprintf.c
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2004-01-15 19:12:17 +0000
committerJeff Johnston <jjohnstn@redhat.com>2004-01-15 19:12:17 +0000
commit6a150987938abfef78f72d0bf4ed6b427b25e040 (patch)
tree949b48479d75f080146cb875ce6231395e6df4db /newlib/libc/stdio/vfprintf.c
parentd4c437af3e23285bc9aa0ef19b1dcf02aee87a93 (diff)
downloadcygnal-6a150987938abfef78f72d0bf4ed6b427b25e040.tar.gz
cygnal-6a150987938abfef78f72d0bf4ed6b427b25e040.tar.bz2
cygnal-6a150987938abfef78f72d0bf4ed6b427b25e040.zip
2004-01-15 Thomas Pfaff <tpfaff@gmx.net>
* 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.
Diffstat (limited to 'newlib/libc/stdio/vfprintf.c')
-rw-r--r--newlib/libc/stdio/vfprintf.c3
1 files changed, 3 insertions, 0 deletions
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);