2003-12-06 Benjamin Kosnik <bkoz@redhat.com>
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 7 Dec 2003 03:46:14 +0000 (03:46 +0000)
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 7 Dec 2003 03:46:14 +0000 (03:46 +0000)
PR libstdc++/11691
* include/ext/stdio_filebuf.h (stdio_filebuf::stdio_filebuf):
Remove __del argument to file descriptor constructor.
* config/io/basic_file_stdio.h (__basic_file::sys_open): Remove
bool argument.
* config/io/basic_file_stdio.cc: Same.

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

libstdc++-v3/ChangeLog
libstdc++-v3/config/io/basic_file_stdio.cc
libstdc++-v3/config/io/basic_file_stdio.h
libstdc++-v3/include/ext/stdio_filebuf.h

index 8a78125..788500a 100644 (file)
@@ -1,3 +1,12 @@
+2003-12-06  Benjamin Kosnik  <bkoz@redhat.com>
+
+       PR libstdc++/11691 
+       * include/ext/stdio_filebuf.h (stdio_filebuf::stdio_filebuf):
+       Remove __del argument to file descriptor constructor.
+       * config/io/basic_file_stdio.h (__basic_file::sys_open): Remove
+       bool argument.
+       * config/io/basic_file_stdio.cc: Same.
+
 2003-12-05  Benjamin Kosnik  <bkoz@redhat.com>
 
        PR libstdc++/13189
index 3025de5..e03e869 100644 (file)
@@ -140,8 +140,7 @@ namespace std
   }
   
   __basic_file<char>*
-  __basic_file<char>::sys_open(int __fd, ios_base::openmode __mode, 
-                              bool __del) 
+  __basic_file<char>::sys_open(int __fd, ios_base::openmode __mode)
   {
     __basic_file* __ret = NULL;
     int __p_mode = 0;
@@ -151,12 +150,9 @@ namespace std
     _M_open_mode(__mode, __p_mode, __rw_mode, __c_mode);
     if (!this->is_open() && (_M_cfile = fdopen(__fd, __c_mode)))
       {
-       // Iff __del is true, then close will fclose the fd.
-       _M_cfile_created = __del;
-
+       _M_cfile_created = true;
        if (__fd == 0)
          setvbuf(_M_cfile, reinterpret_cast<char*>(NULL), _IONBF, 0);
-
        __ret = this;
       }
     return __ret;
@@ -199,7 +195,7 @@ namespace std
   __basic_file<char>* 
   __basic_file<char>::close()
   { 
-    __basic_file* __retval = static_cast<__basic_file*>(NULL);
+    __basic_file* __ret = static_cast<__basic_file*>(NULL);
     if (this->is_open())
       {
        if (_M_cfile_created)
@@ -207,9 +203,9 @@ namespace std
        else
          fflush(_M_cfile);
        _M_cfile = 0;
-       __retval = this;
+       __ret = this;
       }
-    return __retval;
+    return __ret;
   }
  
   streamsize 
index 212ebbe..d6a06ea 100644 (file)
@@ -1,6 +1,6 @@
 // Wrapper of C-language FILE struct -*- C++ -*-
 
-// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -74,7 +74,7 @@ namespace std
       sys_open(__c_file* __file, ios_base::openmode);
 
       __basic_file*
-      sys_open(int __fd, ios_base::openmode __mode, bool __del);
+      sys_open(int __fd, ios_base::openmode __mode);
 
       __basic_file* 
       close(); 
index 9e04807..142af37 100644 (file)
@@ -65,14 +65,12 @@ namespace __gnu_cxx
       /**
        *  @param  fd  An open file descriptor.
        *  @param  mode  Same meaning as in a standard filebuf.
-       *  @param  del  Whether to close the file on destruction.
        *  @param  size  Optimal or preferred size of internal buffer, in chars.
        *
        *  This constructor associates a file stream buffer with an open
-       *  POSIX file descriptor.  Iff @a del is true, then the associated
-       *  file will be closed when the stdio_filebuf is closed/destroyed.
+       *  POSIX file descriptor.
       */
-      stdio_filebuf(int __fd, std::ios_base::openmode __mode, bool __del, 
+      stdio_filebuf(int __fd, std::ios_base::openmode __mode, 
                    size_t __size = static_cast<size_t>(BUFSIZ));
 
       /**
@@ -114,10 +112,9 @@ namespace __gnu_cxx
 
   template<typename _CharT, typename _Traits>
     stdio_filebuf<_CharT, _Traits>::
-    stdio_filebuf(int __fd, std::ios_base::openmode __mode, bool __del, 
-                 size_t __size)
+    stdio_filebuf(int __fd, std::ios_base::openmode __mode, size_t __size)
     {
-      this->_M_file.sys_open(__fd, __mode, __del);
+      this->_M_file.sys_open(__fd, __mode);
       if (this->is_open())
        {
          this->_M_mode = __mode;