From 5f10701fdc7a4708101f7931c15b7146c4f06690 Mon Sep 17 00:00:00 2001 From: Paul Pluzhnikov Date: Mon, 31 Dec 2018 19:14:28 -0800 Subject: libio: use stdout in puts and putchar, etc [BZ #24051]. GLIBC explicitly allows one to assign a new FILE pointer to stdout and other standard streams. printf and wprintf were honouring assignment to stdout and using the new value, but puts, putchar, and wide char variants did not. The stdout part is fixed here. The stdin part will be fixed in a followup. --- libio/putwchar.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libio/putwchar.c') diff --git a/libio/putwchar.c b/libio/putwchar.c index 8d6b6a4..1f5c417 100644 --- a/libio/putwchar.c +++ b/libio/putwchar.c @@ -22,8 +22,8 @@ wint_t putwchar (wchar_t wc) { wint_t result; - _IO_acquire_lock (_IO_stdout); - result = _IO_putwc_unlocked (wc, _IO_stdout); - _IO_release_lock (_IO_stdout); + _IO_acquire_lock (stdout); + result = _IO_putwc_unlocked (wc, stdout); + _IO_release_lock (stdout); return result; } -- cgit v1.1