HomeFreeBSD

libc __sfvwrite(): roll back FILE buffer pointer on fflush error

Description

libc __sfvwrite(): roll back FILE buffer pointer on fflush error

__sfvwrite() advances the pointer before calling fflush. If fflush()
fails, it is not enough to roll back inside it, because we cannot know
how much was advanced by the caller.

Reported by: Peter <pmc@citylink.dinoex.sub.org>
Approved by: re (gjb)
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Fixes: 86a16ada1ea608408cec370171d9f59353e97c77

(cherry picked from commit bafaa70b6f9098d83d074968c8e6747ecec1e118)
(cherry picked from commit 647f02d68a60b66d063a15feed3c817966114d52)

Details

Provenance
kibAuthored on Mar 6 2022, 8:59 AM
markjCommitted on Mar 14 2022, 3:47 PM
Parents
rG61f45ca2da55: buf_alloc(): Stop using LK_NOWAIT, use LK_NOWITNESS
Branches
Unknown
Tags
Unknown