PR libstdc++/81751 don't call fflush(NULL)
authorJonathan Wakely <jwakely@redhat.com>
Wed, 9 Aug 2017 17:52:10 +0000 (18:52 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 9 Aug 2017 17:52:10 +0000 (18:52 +0100)
commit04d07b61cb80fd97e98eb39451ff6a8675a63d90
tree2f1a5e8476f916373aca9ab3ebd0606ceaf5f9c5
parenta171ac0380a22f992d9c57a4189ddfc834d0e022
PR libstdc++/81751 don't call fflush(NULL)

PR libstdc++/79820
PR libstdc++/81751
* config/io/basic_file_stdio.cc (sys_open(FILE*, ios_base::openmode)):
Call fflush on the stream instead of calling sync() while _M_cfile is
null. Restore original value of errno.
* testsuite/ext/stdio_filebuf/char/79820.cc: New.
* testsuite/ext/stdio_filebuf/char/81751.cc: New.

From-SVN: r250993
libstdc++-v3/ChangeLog
libstdc++-v3/config/io/basic_file_stdio.cc
libstdc++-v3/testsuite/ext/stdio_filebuf/char/79820.cc [new file with mode: 0644]
libstdc++-v3/testsuite/ext/stdio_filebuf/char/81751.cc [new file with mode: 0644]