Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2014-09-05 13:42:15 +0400
committerCorinna Vinschen <corinna@vinschen.de>2014-09-05 13:42:15 +0400
commite7565f10886bac86410db6eb6fda47da1d04ac9b (patch)
tree48b443b792d08d2d0880bce6647f77cee1291b9c
parent1ec7de72712ad91fa5cf486db50938f8657a0c92 (diff)
* libc/stdio/findfp.c (_cleanup_r): Call _fflush_r when configuration
option "--enable-lite-exit" is in effect. Refactor the code.
-rw-r--r--newlib/ChangeLog5
-rw-r--r--newlib/libc/stdio/findfp.c13
2 files changed, 14 insertions, 4 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 8f718214c..909dee6ed 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,5 +1,10 @@
2014-09-05 Bin Cheng <bin.cheng@arm.com>
+ * libc/stdio/findfp.c (_cleanup_r): Call _fflush_r when configuration
+ option "--enable-lite-exit" is in effect. Refactor the code.
+
+2014-09-05 Bin Cheng <bin.cheng@arm.com>
+
* libc/stdio/fwalk.c (_fwalk_reent): Remove redundant test.
2014-09-04 Freddie Chopin <freddie_chopin@op.pl>
diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c
index 9ee43b53d..27408f548 100644
--- a/newlib/libc/stdio/findfp.c
+++ b/newlib/libc/stdio/findfp.c
@@ -174,17 +174,22 @@ _VOID
_DEFUN(_cleanup_r, (ptr),
struct _reent *ptr)
{
+ int (*cleanup_func) (struct _reent *, FILE *);
#ifdef _STDIO_BSD_SEMANTICS
/* BSD and Glibc systems only flush streams which have been written to
at exit time. Calling flush rather than close for speed, as on
the aforementioned systems. */
- _CAST_VOID _fwalk_reent (ptr, __sflushw_r);
+ cleanup_func = __sflushw_r;
#else
/* Otherwise close files and flush read streams, too.
- FIXME: Do we really have to call fclose rather than fflush for
- RTOS compatibility? */
- _CAST_VOID _fwalk_reent (ptr, _fclose_r);
+ Note we call flush directly if "--enable-lite-exit" is in effect. */
+#ifdef _LITE_EXIT
+ cleanup_func = _fflush_r;
+#else
+ cleanup_func = _fclose_r;
+#endif
#endif
+ _CAST_VOID _fwalk_reent (ptr, cleanup_func);
}
#ifndef _REENT_ONLY