2006-06-15 Corinna Vinschen <corinna@vinschen.de>

* libc/include/stdio.h (__sgetc_r): Fix typo.
        * libc/stdio/fread.c (_fread_r): Convert crlf calls to crlf_r.
        * libc/stdio/rget.c (__srbuf): Reinstantiate.
        * libc/stdio/wbuf.c (__swbuf): Ditto.
This commit is contained in:
Jeff Johnston 2006-06-15 16:08:09 +00:00
parent dac1814fbe
commit c8956c6fec
5 changed files with 32 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2006-06-15 Corinna Vinschen <corinna@vinschen.de>
* libc/include/stdio.h (__sgetc_r): Fix typo.
* libc/stdio/fread.c (_fread_r): Convert crlf calls to crlf_r.
* libc/stdio/rget.c (__srbuf): Reinstantiate.
* libc/stdio/wbuf.c (__swbuf): Ditto.
2006-06-14 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h: Add new reentrant I/O prototypes for

View File

@ -402,7 +402,7 @@ FILE *_EXFUN(funopen,(const _PTR _cookie,
#define __sgetc_raw_r(__ptr, __f) (--(__f)->_r < 0 ? __srget_r(__ptr, __f) : (int)(*(__f)->_p++))
#ifdef __SCLE
static __inline__ int __sgetc_r(struct _REENT *__ptr, FILE *__p)
static __inline__ int __sgetc_r(struct _reent *__ptr, FILE *__p)
{
int __c = __sgetc_raw_r(__ptr, __p);
if ((__p->_flags & __SCLE) && (__c == '\r'))

View File

@ -196,7 +196,7 @@ _DEFUN(_fread_r, (ptr, buf, size, count, fp),
if (fp->_flags & __SCLE)
{
_funlockfile (fp);
return crlf (fp, buf, total-resid, 1) / size;
return crlf_r (ptr, fp, buf, total-resid, 1) / size;
}
#endif
_funlockfile (fp);
@ -221,7 +221,7 @@ _DEFUN(_fread_r, (ptr, buf, size, count, fp),
if (fp->_flags & __SCLE)
{
_funlockfile (fp);
return crlf (fp, buf, total-resid, 1) / size;
return crlf_r (ptr, fp, buf, total-resid, 1) / size;
}
#endif
_funlockfile (fp);
@ -238,7 +238,7 @@ _DEFUN(_fread_r, (ptr, buf, size, count, fp),
if (fp->_flags & __SCLE)
{
_funlockfile (fp);
return crlf(fp, buf, total, 0) / size;
return crlf_r(ptr, fp, buf, total, 0) / size;
}
#endif
_funlockfile (fp);

View File

@ -43,3 +43,13 @@ _DEFUN(__srget_r, (ptr, fp),
}
return EOF;
}
/* This function isn't any longer declared in stdio.h, but it's
required for backward compatibility with applications built against
earlier dynamically built newlib libraries. */
int
_DEFUN(__srget, (fp),
register FILE *fp)
{
return __srget_r (_REENT, fp);
}

View File

@ -85,3 +85,14 @@ _DEFUN(__swbuf_r, (ptr, c, fp),
return EOF;
return c;
}
/* This function isn't any longer declared in stdio.h, but it's
required for backward compatibility with applications built against
earlier dynamically built newlib libraries. */
int
_DEFUN(__swbuf, (c, fp),
register int c _AND
register FILE *fp)
{
return __swbuf_r (_REENT, c, fp);
}