diff options
-rw-r--r-- | newlib/libc/stdio/fflush.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/findfp.c | 8 | ||||
-rw-r--r-- | newlib/libc/stdio/local.h | 1 | ||||
-rw-r--r-- | newlib/libc/stdio/makebuf.c | 1 |
4 files changed, 5 insertions, 7 deletions
diff --git a/newlib/libc/stdio/fflush.c b/newlib/libc/stdio/fflush.c index f2d0d9b..2b5f13b 100644 --- a/newlib/libc/stdio/fflush.c +++ b/newlib/libc/stdio/fflush.c @@ -234,7 +234,7 @@ __sflush_r (struct _reent *ptr, } #ifdef _STDIO_BSD_SEMANTICS -/* Called from _cleanup_r. At exit time, we don't need file locking, +/* Called from cleanup_stdio(). At exit time, we don't need file locking, and we don't want to move the underlying file pointer unless we're writing. */ int diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c index eca47bd..aa5e366 100644 --- a/newlib/libc/stdio/findfp.c +++ b/newlib/libc/stdio/findfp.c @@ -199,8 +199,8 @@ found: * The name `_cleanup' is, alas, fairly well known outside stdio. */ -void -_cleanup_r (struct _reent *ptr) +static void +cleanup_stdio (struct _reent *ptr) { int (*cleanup_func) (struct _reent *, FILE *); #ifdef _STDIO_BSD_SEMANTICS @@ -232,7 +232,7 @@ _cleanup_r (struct _reent *ptr) void _cleanup (void) { - _cleanup_r (_GLOBAL_REENT); + cleanup_stdio (_GLOBAL_REENT); } #endif @@ -252,7 +252,7 @@ __sinit (struct _reent *s) } /* make sure we clean up on exit */ - s->__cleanup = _cleanup_r; /* conservative */ + s->__cleanup = cleanup_stdio; /* conservative */ s->__sglue._next = NULL; #ifndef _REENT_SMALL diff --git a/newlib/libc/stdio/local.h b/newlib/libc/stdio/local.h index 86422eb..50818db 100644 --- a/newlib/libc/stdio/local.h +++ b/newlib/libc/stdio/local.h @@ -180,7 +180,6 @@ extern _fpos_t __sseek (struct _reent *, void *, _fpos_t, int); extern int __sclose (struct _reent *, void *); extern int __stextmode (int); extern void __sinit (struct _reent *); -extern void _cleanup_r (struct _reent *); extern void __smakebuf_r (struct _reent *, FILE *); extern int __swhatbuf_r (struct _reent *, FILE *, size_t *, int *); extern int _fwalk_reent (struct _reent *, int (*)(struct _reent *, FILE *)); diff --git a/newlib/libc/stdio/makebuf.c b/newlib/libc/stdio/makebuf.c index 0030812..b9c75bb 100644 --- a/newlib/libc/stdio/makebuf.c +++ b/newlib/libc/stdio/makebuf.c @@ -61,7 +61,6 @@ __smakebuf_r (struct _reent *ptr, } else { - ptr->__cleanup = _cleanup_r; fp->_flags |= __SMBF; fp->_bf._base = fp->_p = (unsigned char *) p; fp->_bf._size = size; |