diff options
author | jhb <jhb@FreeBSD.org> | 2010-03-11 17:03:32 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2010-03-11 17:03:32 +0000 |
commit | 2684d78c89ad7cfd18346398691e6e03d263f6c6 (patch) | |
tree | e077a892f44aba8196f30652e58ab6d758a2af4a /lib/libc/stdio/vdprintf.c | |
parent | 03101f1cf6eaf4791f0ae5844d6c40b9f282a3ef (diff) | |
download | FreeBSD-src-2684d78c89ad7cfd18346398691e6e03d263f6c6.zip FreeBSD-src-2684d78c89ad7cfd18346398691e6e03d263f6c6.tar.gz |
- Use an initializer macro to initialize fields in 'fake' FILE objects used
by *sprintf(), etc.
- Explicitly initialize _fl_mutex to PTHREAD_MUTEX_INITIALIZER for all FILE
objects. This is currently a nop on FreeBSD, but is import for other
platforms (or in the future) where PTHREAD_MUTEX_INITIALIZER is not simply
zero.
PR: threads/141198
Reported by: Jeremy Huddleston @ Apple
MFC after: 2 weeks
Diffstat (limited to 'lib/libc/stdio/vdprintf.c')
-rw-r--r-- | lib/libc/stdio/vdprintf.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/libc/stdio/vdprintf.c b/lib/libc/stdio/vdprintf.c index 2703022..3ad273e 100644 --- a/lib/libc/stdio/vdprintf.c +++ b/lib/libc/stdio/vdprintf.c @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); int vdprintf(int fd, const char * __restrict fmt, va_list ap) { - FILE f; + FILE f = FAKE_FILE; unsigned char buf[BUFSIZ]; int ret; @@ -56,8 +56,6 @@ vdprintf(int fd, const char * __restrict fmt, va_list ap) f._write = __swrite; f._bf._base = buf; f._bf._size = sizeof(buf); - f._orientation = 0; - bzero(&f._mbstate, sizeof(f._mbstate)); if ((ret = __vfprintf(&f, fmt, ap)) < 0) return (ret); |