OSDN Git Service

2009-04-06 H.J. Lu <hongjiu.lu@intel.com>
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 6 Apr 2009 23:07:51 +0000 (23:07 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 6 Apr 2009 23:07:51 +0000 (23:07 +0000)
PR libgfortran/39664
* io/unix.c (raw_close): Don't close STDOUT_FILENO,
STDERR_FILENO nor STDIN_FILENO.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145636 138bc75d-0d04-0410-961f-82ee72b054a4

libgfortran/ChangeLog
libgfortran/io/unix.c

index f2cf222..b1a4e19 100644 (file)
@@ -1,3 +1,9 @@
+2009-04-06  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR libgfortran/39664
+       * io/unix.c (raw_close): Don't close STDOUT_FILENO,
+       STDERR_FILENO nor STDIN_FILENO.
+
 2009-04-06  David Edelsohn  <edelsohn@gnu.org>
        
        * io/io.h (struct stream): Rename truncate to trunc.
@@ -14,7 +20,7 @@
 
 2009-04-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
-        PR libfortran/37754
+       PR libfortran/37754
        * io/io.h (format_hash_entry): New structure for hash table.
        (format_hash_table): The hash table itself.
        (free_format_data): Revise function prototype.
@@ -47,7 +53,7 @@
        
 2009-04-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
-        PR libfortran/37754
+       PR libfortran/37754
        * io/transfer.c (formatted_transfer_scalar): Remove this function by
        factoring it into two new functions, one for read and one for write,
        eliminating all the conditionals for read or write mode.
@@ -57,7 +63,7 @@
 
 2009-04-05  Janne Blomqvist  <jb@gcc.gnu.org>
 
-        PR libfortran/25561 libfortran/37754
+       PR libfortran/25561 libfortran/37754
        * io/io.h (struct stream): Define new stream interface function
        pointers, and inline functions for accessing it.
        (struct fbuf): Use int instead of size_t, remove flushed element.
@@ -79,7 +85,7 @@
        (fbuf_read): New prototype.
        (fbuf_getc_refill): New prototype.
        (fbuf_getc): New inline function.
-        * io/fbuf.c (fbuf_init): Use int, get rid of flushed.
+       * io/fbuf.c (fbuf_init): Use int, get rid of flushed.
        (fbuf_debug): New function.
        (fbuf_reset): Flush, and return position offset.
        (fbuf_alloc): Simplify, don't flush, just realloc.
        PR libfortran/34670
        * intrinsics/reshape_generic.c:  Add bounds checking.
        * m4/reshape.m4:  Likewise.
-        * generated/reshape_c10.c: Regenerated.
-        * generated/reshape_c16.c: Regenerated.
-        * generated/reshape_c4.c: Regenerated.
-        * generated/reshape_c8.c: Regenerated.
-        * generated/reshape_i16.c: Regenerated.
-        * generated/reshape_i4.c: Regenerated.
-        * generated/reshape_i8.c: Regenerated.
-        * generated/reshape_r10.c: Regenerated.
-        * generated/reshape_r16.c: Regenerated.
-        * generated/reshape_r4.c: Regenerated.
-        * generated/reshape_r8.c: Regenerated.
-        * generated/spread_r4.c: Regenerated.
+       * generated/reshape_c10.c: Regenerated.
+       * generated/reshape_c16.c: Regenerated.
+       * generated/reshape_c4.c: Regenerated.
+       * generated/reshape_c8.c: Regenerated.
+       * generated/reshape_i16.c: Regenerated.
+       * generated/reshape_i4.c: Regenerated.
+       * generated/reshape_i8.c: Regenerated.
+       * generated/reshape_r10.c: Regenerated.
+       * generated/reshape_r16.c: Regenerated.
+       * generated/reshape_r4.c: Regenerated.
+       * generated/reshape_r8.c: Regenerated.
+       * generated/spread_r4.c: Regenerated.
 
 2008-10-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org
 
        than the sub-object.
 
 2008-09-26  Peter O'Gorman  <pogma@thewrittenword.com>
-            Steve Ellcey  <sje@cup.hp.com>
+           Steve Ellcey  <sje@cup.hp.com>
 
        * configure: Regenerate for new libtool.
        * Makefile.in: Ditto.
index 0d2650b..4f8cbb5 100644 (file)
@@ -344,7 +344,12 @@ raw_close (unix_stream * s)
 {
   int retval;
   
-  retval = close (s->fd);
+  if (s->fd != STDOUT_FILENO
+      && s->fd != STDERR_FILENO
+      && s->fd != STDIN_FILENO)
+    retval = close (s->fd);
+  else
+    retval = SUCCESS;
   free_mem (s);
   return retval;
 }