unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] libio: do not cleanup wide buffers of legacy standard files [BZ #24228]
@ 2019-02-18 12:44 Dmitry V. Levin
  2019-02-18 12:56 ` Florian Weimer
  0 siblings, 1 reply; 20+ messages in thread
From: Dmitry V. Levin @ 2019-02-18 12:44 UTC (permalink / raw)
  To: libc-alpha

Commit glibc-2.23~693 (a601b74d31ca086de38441d316a3dee24c866305)
introduced a regression: _IO_unbuffer_all() now invokes _IO_wsetb() to
free wide buffers of all files, including legacy standard files that
are small statically allocated objects that do not have wide buffers.

Fix this by skipping _IO_wsetb() invocation for legacy standard files.

[BZ #24228]
* libio/genops.c (_IO_unbuffer_all)
[SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)]: Skip _IO_wsetb() invocation
for legacy standard files.
---
 ChangeLog      | 7 +++++++
 libio/genops.c | 7 +++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/libio/genops.c b/libio/genops.c
index 2a0d9b81df..c53696f2e0 100644
--- a/libio/genops.c
+++ b/libio/genops.c
@@ -816,8 +816,11 @@ _IO_unbuffer_all (void)
 
 	  _IO_SETBUF (fp, NULL, 0);
 
-	  if (fp->_mode > 0)
-	    _IO_wsetb (fp, NULL, NULL, 0);
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
+	  if (!_IO_legacy_file (fp))
+#endif
+	    if (fp->_mode > 0)
+	      _IO_wsetb (fp, NULL, NULL, 0);
 
 #ifdef _IO_MTSAFE_IO
 	  if (cnt < MAXTRIES && fp->_lock != NULL)
-- 
ldv

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2019-06-20 17:42 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-18 12:44 [PATCH] libio: do not cleanup wide buffers of legacy standard files [BZ #24228] Dmitry V. Levin
2019-02-18 12:56 ` Florian Weimer
2019-02-18 19:10   ` Dmitry V. Levin
2019-02-18 21:38     ` [PATCH v2] " Dmitry V. Levin
2019-02-19  0:57     ` [PATCH] " Dmitry V. Levin
2019-02-19  1:29       ` [PATCH v3] libio: do not unbuffer legacy standard files in compatibility mode " Dmitry V. Levin
2019-03-13 15:08         ` Florian Weimer
2019-03-13 15:46           ` Dmitry V. Levin
2019-03-13 15:49             ` Florian Weimer
2019-03-13 15:59               ` Dmitry V. Levin
2019-06-19 13:10         ` Florian Weimer
2019-06-19 16:03           ` Dmitry V. Levin
2019-06-19 16:15             ` Florian Weimer
2019-06-19 17:46               ` Dmitry V. Levin
2019-06-19 19:04                 ` Florian Weimer
2019-06-19 19:51                   ` [PATCH v4] libio: do not attempt to free wide buffers of legacy streams " Dmitry V. Levin
2019-06-19 21:15                     ` Florian Weimer
2019-06-19 22:08                       ` [PATCH v5] " Dmitry V. Levin
2019-06-20  8:59                         ` Florian Weimer
2019-06-20 17:42                           ` Dmitry V. Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).