summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdio/vfprintf.c
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2004-05-07 21:00:41 +0000
committerJeff Johnston <jjohnstn@redhat.com>2004-05-07 21:00:41 +0000
commit186420eccf901499b2503548e0cd51c76f781954 (patch)
tree8b1a455ea5df3517d59fdf29b755a7512a353c45 /newlib/libc/stdio/vfprintf.c
parent631fbe65fa105a836d21838152f2125067f2f27a (diff)
downloadcygnal-186420eccf901499b2503548e0cd51c76f781954.tar.gz
cygnal-186420eccf901499b2503548e0cd51c76f781954.tar.bz2
cygnal-186420eccf901499b2503548e0cd51c76f781954.zip
2004-05-07 Artem B. Bityuckiy <abitytsky@softminecorp.com>
* libc/stdio/iprintf.c (_iprintf_r): Fix old-style argument list for reentrant pointer. Call _vfiprintf_r. * libc/stdio/siprintf.c (_siprintf_r): New function. * libc/stdio/vfprintf.c (__sbprintf): Add reetrant struct pointer argument. Change all callers. Call _VFPRINTF_R. * libc/include/stdio.h (_siprintf_r, _vfiprintf_r): New prototypes.
Diffstat (limited to 'newlib/libc/stdio/vfprintf.c')
-rw-r--r--newlib/libc/stdio/vfprintf.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c
index b72117582..906934787 100644
--- a/newlib/libc/stdio/vfprintf.c
+++ b/newlib/libc/stdio/vfprintf.c
@@ -233,8 +233,9 @@ _DEFUN(__sprint, (fp, uio),
* worries about ungetc buffers and so forth.
*/
static int
-_DEFUN(__sbprintf, (fp, fmt, ap),
- register FILE *fp _AND
+_DEFUN(__sbprintf, (rptr, fp, fmt, ap),
+ struct _reent *rptr _AND
+ register FILE *fp _AND
_CONST char *fmt _AND
va_list ap)
{
@@ -257,7 +258,7 @@ _DEFUN(__sbprintf, (fp, fmt, ap),
#endif
/* do the work, then copy any error status */
- ret = VFPRINTF (&fake, fmt, ap);
+ ret = _VFPRINTF_R (rptr, &fake, fmt, ap);
if (ret >= 0 && fflush(&fake))
ret = EOF;
if (fake._flags & __SERR)
@@ -541,7 +542,7 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap),
/* optimise fprintf(stderr) (and other unbuffered Unix files) */
if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) &&
fp->_file >= 0)
- return (__sbprintf (fp, fmt0, ap));
+ return (__sbprintf (data, fp, fmt0, ap));
fmt = (char *)fmt0;
uio.uio_iov = iovp = iov;