]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Synchronize with mainline.
authorUlrich Drepper <drepper@redhat.com>
Wed, 3 Apr 2002 03:08:14 +0000 (03:08 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 3 Apr 2002 03:08:14 +0000 (03:08 +0000)
libio/fileops.c
libio/iofclose.c

index e732e9277c16e22f3e8ebf393b825d22b70d967e..f429a6be90611fe7ffb64a8ea25c5ca7f8de00b7 100644 (file)
@@ -175,6 +175,8 @@ _IO_new_file_close_it (fp)
 #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
   else
     {
+      if (_IO_have_wbackup (fp))
+       _IO_free_wbackup_area (fp);
       _IO_wsetb (fp, NULL, NULL, 0);
       _IO_wsetg (fp, NULL, NULL, NULL);
       _IO_wsetp (fp, NULL, NULL);
index 45bd0afa7d5a1d3b5009b4c309100d49eadd6a3e..0cf23429abbfba83aca372ed8c64fd9425cac3f0 100644 (file)
@@ -65,6 +65,7 @@ _IO_new_fclose (fp)
     status = fp->_flags & _IO_ERR_SEEN ? -1 : 0;
   _IO_FINISH (fp);
   _IO_funlockfile (fp);
+  _IO_cleanup_region_end (0);
   if (fp->_mode > 0)
     {
 #if _LIBC
@@ -76,9 +77,11 @@ _IO_new_fclose (fp)
       __gconv_release_step (cc->__cd_out.__cd.__steps);
 #endif
     }
-  _IO_cleanup_region_end (0);
-  if (_IO_have_backup (fp))
-    _IO_free_backup_area (fp);
+  else
+    {
+      if (_IO_have_backup (fp))
+       _IO_free_backup_area (fp);
+    }
   if (fp != _IO_stdin && fp != _IO_stdout && fp != _IO_stderr)
     {
       fp->_IO_file_flags = 0;