]> sourceware.org Git - newlib-cygwin.git/commitdiff
2013-04-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
authorJoel Sherrill <joel.sherrill@oarcorp.com>
Thu, 25 Apr 2013 15:29:19 +0000 (15:29 +0000)
committerJoel Sherrill <joel.sherrill@oarcorp.com>
Thu, 25 Apr 2013 15:29:19 +0000 (15:29 +0000)
* libc/stdio/local.h (_STDIO_CLOSE_PER_REENT_STD_STREAMS): New define.
* libc/stdio/findfp.c (_STDIO_CLOSE_PER_REENT_STD_STREAMS): Use define.

newlib/ChangeLog
newlib/libc/stdio/findfp.c
newlib/libc/stdio/local.h

index 60074fc76fa29586640bfdfe18cc8c5c209c7261..4f8ad0588f04ecf6b7ed73b5da901d84b54a74c8 100644 (file)
@@ -1,3 +1,8 @@
+2013-04-25  Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+       * libc/stdio/local.h (_STDIO_CLOSE_PER_REENT_STD_STREAMS): New define.
+       * libc/stdio/findfp.c (_STDIO_CLOSE_PER_REENT_STD_STREAMS): Use define.
+
 2013-04-24  Corinna Vinschen  <vinschen@redhat.com>
            Nick Clifton  <nickc@redhat.com>
 
index 7ab3bdba513d48379397d4dc0ce29789d11eff25..e40500a0776dbaf5e3bc7ada521e254a0cadcb67 100644 (file)
@@ -62,7 +62,11 @@ _DEFUN(std, (ptr, flags, file, data),
   ptr->_flags |= __SL64;
 #endif /* __LARGE64_FILES */
   ptr->_seek = __sseek;
+#ifdef _STDIO_CLOSE_PER_REENT_STD_STREAMS
   ptr->_close = __sclose;
+#else /* _STDIO_CLOSE_STD_STREAMS */
+  ptr->_close = NULL;
+#endif /* _STDIO_CLOSE_STD_STREAMS */
 #if !defined(__SINGLE_THREAD__) && !defined(_REENT_SMALL)
   __lock_init_recursive (ptr->_lock);
   /*
index cbfeac77d32ff3ca961761129fbac5911a0391dc..ec5efab49b807be9238b397ce72c65ff027f46dd 100644 (file)
 # include <io.h>
 #endif
 
+/* The following define determines if the per-reent stdin, stdout and stderr
+   streams are closed during _reclaim_reent().  The stdin, stdout and stderr
+   streams are initialized to use file descriptors 0, 1 and 2 respectively.  In
+   case _STDIO_CLOSE_PER_REENT_STD_STREAMS is defined these file descriptors
+   will be closed via close() provided the owner of the reent structure
+   triggerd the on demand reent initilization, see CHECK_INIT(). */
+#ifndef __rtems__
+#define _STDIO_CLOSE_PER_REENT_STD_STREAMS
+#endif
+
 /* The following macros are supposed to replace calls to _flockfile/_funlockfile
    and __sfp_lock_acquire/__sfp_lock_release.  In case of multi-threaded
    environments using pthreads, it's not sufficient to lock the stdio functions
This page took 0.057553 seconds and 5 git commands to generate.