summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2007-03-29 06:25:44 +0000
committerNick Clifton <nickc@redhat.com>2007-03-29 06:25:44 +0000
commit519aec5d597336d58443628a2618d87620a4e2cd (patch)
tree95ef5bb02ef92da804663c528a4959bb4e4f2360
parent23197752739c82be1d0bf3eda9b1ef6647328816 (diff)
downloadcygnal-519aec5d597336d58443628a2618d87620a4e2cd.tar.gz
cygnal-519aec5d597336d58443628a2618d87620a4e2cd.tar.bz2
cygnal-519aec5d597336d58443628a2618d87620a4e2cd.zip
Reflect changes made to generic vfprintf.c:
* libc/machine/powerpc/vfprintf.c (__sprint): Rename to __sprint_r and add a "struct reent *" argument. (__sbprintf): Rename to __sbprintf_r, add a "struct reent *" argument and call _VFPRINTF_R instead of VFPRINTF. (_VFPRINTF_R): Add data pointer to call to cantwrite(). Fix uses of __sprint() and __sbprintf.
-rw-r--r--newlib/ChangeLog20
-rw-r--r--newlib/libc/machine/powerpc/vfprintf.c20
2 files changed, 32 insertions, 8 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 50a5b3727..fa0a2780e 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,23 @@
+2007-03-29 Nick Clifton <nickc@redhat.com>
+
+ Reflect changes made to generic vfprintf.c:
+ * libc/machine/powerpc/vfprintf.c (__sprint): Rename to __sprint_r
+ and add a "struct reent *" argument.
+ (__sbprintf): Rename to __sbprintf_r, add a "struct reent *"
+ argument and call _VFPRINTF_R instead of VFPRINTF.
+ (_VFPRINTF_R): Add data pointer to call to cantwrite().
+ Fix uses of __sprint() and __sbprintf.
+
+2007-03-20 Nick Clifton <nickc@redhat.com>
+
+ Reflect changes made to generic vfprintf.c:
+ * libc/machine/powerpc/vfprintf.c (__sprint): Rename to __sprint_r
+ and add a "struct reent *" argument.
+ (__sbprintf): Rename to __sbprintf_r, add a "struct reent *"
+ argument and call _VFPRINTF_R instead of VFPRINTF.
+ (_VFPRINTF_R): Add data pointer to call to cantwrite().
+ Fix uses of __sprint() and __sbprintf.
+
2007-03-16 Charles Wilson <cygwin@...>
* libc/argz/argz_insert.c: "before" pointer is
diff --git a/newlib/libc/machine/powerpc/vfprintf.c b/newlib/libc/machine/powerpc/vfprintf.c
index e84be15aa..2b2cec381 100644
--- a/newlib/libc/machine/powerpc/vfprintf.c
+++ b/newlib/libc/machine/powerpc/vfprintf.c
@@ -207,7 +207,8 @@ typedef union
* then reset it so that it can be reused.
*/
static int
-__sprint(fp, uio)
+__sprint_r(rptr, fp, uio)
+ struct _reent *rptr;
FILE *fp;
register struct __suio *uio;
{
@@ -217,7 +218,7 @@ __sprint(fp, uio)
uio->uio_iovcnt = 0;
return (0);
}
- err = __sfvwrite(fp, uio);
+ err = __sfvwrite_r(rptr, fp, uio);
uio->uio_resid = 0;
uio->uio_iovcnt = 0;
return (err);
@@ -229,7 +230,8 @@ __sprint(fp, uio)
* worries about ungetc buffers and so forth.
*/
static int
-__sbprintf(fp, fmt, ap)
+__sbprintf_r(rptr, fp, fmt, ap)
+ struct _reent *rptr;
register FILE *fp;
const char *fmt;
va_list ap;
@@ -250,7 +252,7 @@ __sbprintf(fp, fmt, ap)
fake._lbfsize = 0; /* not actually used, but Just In Case */
/* 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)
@@ -410,7 +412,7 @@ _DEFUN (_VFPRINTF_R, (data, fp, fmt0, ap),
uio.uio_resid += (len); \
iovp++; \
if (++uio.uio_iovcnt >= NIOV) { \
- if (__sprint(fp, &uio)) \
+ if (__sprint_r(data, fp, &uio)) \
goto error; \
iovp = iov; \
} \
@@ -425,7 +427,7 @@ _DEFUN (_VFPRINTF_R, (data, fp, fmt0, ap),
} \
}
#define FLUSH() { \
- if (uio.uio_resid && __sprint(fp, &uio)) \
+ if (uio.uio_resid && __sprint_r(data, fp, &uio)) \
goto error; \
uio.uio_iovcnt = 0; \
iovp = iov; \
@@ -520,13 +522,15 @@ _DEFUN (_VFPRINTF_R, (data, fp, fmt0, ap),
memset (&state, '\0', sizeof (state));
/* sorry, fprintf(read_only_file, "") returns EOF, not 0 */
- if (cantwrite(fp))
+ if (cantwrite (data, fp)) {
+ _funlockfile (fp);
return (EOF);
+ }
/* 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_r(data, fp, fmt0, ap));
fmt = (char *)fmt0;
uio.uio_iov = iovp = iov;