]> sourceware.org Git - newlib-cygwin.git/commitdiff
2005-02-08 Antony King <antony.king@st.com>
authorJeff Johnston <jjohnstn@redhat.com>
Tue, 8 Feb 2005 19:38:47 +0000 (19:38 +0000)
committerJeff Johnston <jjohnstn@redhat.com>
Tue, 8 Feb 2005 19:38:47 +0000 (19:38 +0000)
        * arm/syscalls.c: Change CHECK_INIT to pass reentrant struct
        instead of file pointer.

libgloss/ChangeLog
libgloss/arm/syscalls.c

index 4a7aed0ccc687c3906184b5d8b2cca8eb2c30931..680fe79856b4c6978abf795ec2b189f26e0b5da2 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-08  Antony King  <antony.king@st.com>
+
+       * arm/syscalls.c: Change CHECK_INIT to pass reentrant struct
+       instead of file pointer.
+
 2005-02-01  Hans-Peter Nilsson  <hp@axis.com>
 
        * cris/Makefile.in (ALL_INSTALL_FILES): New macro.
index 42e69b7b079595fd40f6ff4919d78a74787da0ce..e8902280666a3918dd45a95195204d2b8666dd08 100644 (file)
@@ -55,20 +55,17 @@ register char * stack_ptr asm ("sp");
 
 /* following is copied from libc/stdio/local.h to check std streams */
 extern void   _EXFUN(__sinit,(struct _reent *));
-#define CHECK_INIT(fp) \
-  do                                    \
-    {                                   \
-      if ((fp)->_data == 0)             \
-        (fp)->_data = _REENT;           \
-      if (!(fp)->_data->__sdidinit)     \
-        __sinit ((fp)->_data);          \
-    }                                   \
+#define CHECK_INIT(ptr) \
+  do                                           \
+    {                                          \
+      if ((ptr) && !(ptr)->__sdidinit)         \
+       __sinit (ptr);                          \
+    }                                          \
   while (0)
 
 /* Adjust our internal handles to stay away from std* handles.  */
 #define FILE_HANDLE_OFFSET (0x20)
 
-static int std_files_checked;
 static int monitor_stdin;
 static int monitor_stdout;
 static int monitor_stderr;
@@ -119,13 +116,8 @@ do_AngelSWI (int reason, void * arg)
 static int
 remap_handle (int fh)
 {
-  if (!std_files_checked)
-    {
-       CHECK_INIT(stdin);
-       CHECK_INIT(stdout);
-       CHECK_INIT(stderr);
-       std_files_checked = 1;
-    }
+  CHECK_INIT(_REENT);
+
   if (fh == STDIN_FILENO)
     return monitor_stdin;
   if (fh == STDOUT_FILENO)
This page took 0.036379 seconds and 5 git commands to generate.