]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
__sflush(): on write error, if nothing was written, reset FILE state back
authorKonstantin Belousov <kib@FreeBSD.org>
Sun, 23 Jan 2022 06:52:59 +0000 (08:52 +0200)
committerKonstantin Belousov <kib@FreeBSD.org>
Tue, 25 Jan 2022 15:26:05 +0000 (17:26 +0200)
commit86a16ada1ea608408cec370171d9f59353e97c77
tree0c5efdf3ebd866d7e199e5b7177231c142af3e99
parent59d465e200bb7058dfdb183c061730c10dd5bc03
__sflush(): on write error, if nothing was written, reset FILE state back

otherwise the data is just dropped.  Check for current position equal to
the buffer base at the entry of the function; if not equal, setvbuf()
was done from the write method and it is not our business to override
the decision.

PR: 76398
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D34007
lib/libc/stdio/fflush.c