From ed6859b8f02e456699f85918e4b81457537900fa Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Thu, 16 Sep 2004 21:30:51 +0000 Subject: 2004-09-16 Antony King * libc/include/sys/lock.h: Replaced empty {} with (0) to conform with locking API. * libc/include/sys/stdio.h: (_flockfile)[!_SINGLE_THREAD]: Add check for__SSTR in _flags and if set, skip lock request. (_funlockfile)[!SINGLE_THREAD]: Ditto. * libc/stdio/local.h (CHECK_INIT): Added check that _REENT is not NULL. * libc/stdio/siprintf.c (siprintf, _siprintf_r): Added missing initialisation of _file to -1 in local FILE. * libc/stdio/snprintf.c (snprintf, _snprintf_r): Ditto. * libc/stdio/sscanf.c (sscanf, _sscanf_r): Ditto. * libc/stdio/vsnprintf.c (vsnprintf, _vsnprintf_r): Ditto. * libc/stdio/vsscanf.c (_vsscanf_r): Ditto. * libc/stdio/sscanf.c (sscanf, _sscanf_r): Added __SSTR flag to _flags in local FILE to prevent locking. * libc/stdio/vsscanf.c (_vsscanf_r): Ditto. --- newlib/libc/stdio/vsnprintf.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'newlib/libc/stdio/vsnprintf.c') diff --git a/newlib/libc/stdio/vsnprintf.c b/newlib/libc/stdio/vsnprintf.c index fb80f4192..9fc1b2d89 100644 --- a/newlib/libc/stdio/vsnprintf.c +++ b/newlib/libc/stdio/vsnprintf.c @@ -45,6 +45,7 @@ _DEFUN(vsnprintf, (str, size, fmt, ap), f._flags = __SWR | __SSTR; f._bf._base = f._p = (unsigned char *) str; f._bf._size = f._w = (size > 0 ? size - 1 : 0); + f._file = -1; /* No file. */ ret = _vfprintf_r (_REENT, &f, fmt, ap); if (size > 0) *f._p = 0; @@ -67,6 +68,7 @@ _DEFUN(_vsnprintf_r, (ptr, str, size, fmt, ap), f._flags = __SWR | __SSTR; f._bf._base = f._p = (unsigned char *) str; f._bf._size = f._w = (size > 0 ? size - 1 : 0); + f._file = -1; /* No file. */ ret = _vfprintf_r (ptr, &f, fmt, ap); if (size > 0) *f._p = 0; -- cgit v1.2.3