aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/stdio/xprintf.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2010-03-11 17:03:32 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2010-03-11 17:03:32 +0000
commit1b0181df2f46ef73a41ea8c9b7026718f8eec3a1 (patch)
treee077a892f44aba8196f30652e58ab6d758a2af4a /lib/libc/stdio/xprintf.c
parentf458b72661924d743e52d030b510efad8859face (diff)
downloadsrc-1b0181df2f46ef73a41ea8c9b7026718f8eec3a1.tar.gz
src-1b0181df2f46ef73a41ea8c9b7026718f8eec3a1.zip
- 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
Notes
Notes: svn path=/head/; revision=205021
Diffstat (limited to 'lib/libc/stdio/xprintf.c')
-rw-r--r--lib/libc/stdio/xprintf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/stdio/xprintf.c b/lib/libc/stdio/xprintf.c
index bb41a9c05ddf..0cc8571550bf 100644
--- a/lib/libc/stdio/xprintf.c
+++ b/lib/libc/stdio/xprintf.c
@@ -48,6 +48,7 @@
#include <wchar.h>
#include "un-namespace.h"
+#include "local.h"
#include "printf.h"
#include "fvwrite.h"
@@ -575,7 +576,7 @@ static int
__v3printf(FILE *fp, const char *fmt, int pct, va_list ap)
{
int ret;
- FILE fake;
+ FILE fake = FAKE_FILE;
unsigned char buf[BUFSIZ];
/* copy the important variables */