Author: faridz
Date: Tue Jun 24 22:22:47 2008
New Revision: 671433

URL: http://svn.apache.org/viewvc?rev=671433&view=rev
Log:
2008-06-25  Farid Zaripov  <[EMAIL PROTECTED]>

        STDCXX-969
        * include/fstream.cc (close): Reset input/output sequences to prevent
        any subsequent I/O attempts on closed file.

Modified:
    stdcxx/branches/4.2.x/include/fstream.cc

Modified: stdcxx/branches/4.2.x/include/fstream.cc
URL: 
http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/fstream.cc?rev=671433&r1=671432&r2=671433&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/include/fstream.cc (original)
+++ stdcxx/branches/4.2.x/include/fstream.cc Tue Jun 24 22:22:47 2008
@@ -106,6 +106,10 @@
             _C_file    = 0;
             _C_cur_pos = _C_beg_pos = pos_type (off_type (-1));
 
+            // reset input/output sequences to prevent any
+            // subsequent I/O attempts on closed file
+            this->setg (0, 0, 0);
+            this->setp (0, 0);
         }
 
         // rethrow the caught exception
@@ -119,6 +123,11 @@
         // zero out the file pointer except when detaching fd
         _C_file    = 0;
         _C_cur_pos = _C_beg_pos = pos_type (off_type (-1));
+
+        // reset input/output sequences to prevent any
+        // subsequent I/O attempts on closed file
+        this->setg (0, 0, 0);
+        this->setp (0, 0);
     }
 
     return __retval;


Reply via email to