From: Ulrich Drepper Date: Wed, 3 Apr 2002 03:08:14 +0000 (+0000) Subject: Synchronize with mainline. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d895d17ff0233b0e759cdb7e0eb574dfe6847696;p=thirdparty%2Fglibc.git Synchronize with mainline. --- diff --git a/libio/fileops.c b/libio/fileops.c index e732e9277c1..f429a6be906 100644 --- a/libio/fileops.c +++ b/libio/fileops.c @@ -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); diff --git a/libio/iofclose.c b/libio/iofclose.c index 45bd0afa7d5..0cf23429abb 100644 --- a/libio/iofclose.c +++ b/libio/iofclose.c @@ -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;