fflush(3): Return success on a read-only stream.
commit1d638d9700dbf454f40c66499f6fc0471f177aab
authorzrj <rimvydas.jasinskas@gmail.com>
Sat, 23 Dec 2017 08:29:47 +0000 (23 10:29 +0200)
committerzrj <zrj@dragonflybsd.org>
Sat, 23 Dec 2017 17:01:03 +0000 (23 19:01 +0200)
tree5367b5455538b7800482c8f3b585a019a8403d87
parentfed168dc0e9f403377f160882cbc78e55694ec16
fflush(3): Return success on a read-only stream.

Loosen up the requirements for opened streams. It is needed to support c++
runtime lib after ext/basic_file_stdio.c s/this->sync()/fflush()/ change.
It likely needed for libc++ too.
Adjust the manpage for behaviour change and only set _w to 0 when stream is
not currently reading in fpurge(4) to avoid failures in fflush(4).

Taken-from: FreeBSD
lib/libc/stdio/fflush.3
lib/libc/stdio/fflush.c
lib/libc/stdio/fpurge.c