]> sourceware.org Git - glibc.git/commit
Fix freopen handling of ,ccs= (bug 23675)
authorJoseph Myers <josmyers@redhat.com>
Thu, 5 Sep 2024 20:08:10 +0000 (20:08 +0000)
committerJoseph Myers <josmyers@redhat.com>
Thu, 5 Sep 2024 20:08:10 +0000 (20:08 +0000)
commite44ca1c085b3bd41266c882ea1cb0fd436231635
tree16652486b6f9ec07e8bf584ee95a2915b0dc3caf
parentcc3e743fc09ee6fca45767629df9cbcbe1feba82
Fix freopen handling of ,ccs= (bug 23675)

As reported in bug 23675 and shown up in the recently added tests of
different cases of freopen (relevant part of the test currently
conditioned under #if 0 to avoid a failure resulting from this bug),
freopen wrongly forces the stream to unoriented even when a mode with
,ccs= is specified, though such a mode is supposed to result in a
wide-oriented stream.  Move the clearing of _mode to before the actual
reopening occurs, so that the main fopen implementation can leave a
wide-oriented stream in the ,ccs= case.

Tested for x86_64.
libio/freopen.c
libio/freopen64.c
stdio-common/tst-freopen2-main.c
This page took 0.036857 seconds and 5 git commands to generate.