PR kern/164674

Matthew Story matthewstory at gmail.com
Thu Mar 22 03:43:25 UTC 2012


On Wed, Mar 21, 2012 at 5:45 PM, David Schultz <das at freebsd.org> wrote:

> On Mon, Mar 12, 2012, Matthew Story wrote:
> > On Sun, Mar 4, 2012 at 2:03 PM, John Baldwin <jhb at freebsd.org> wrote:
>
[...snip]

> There ought to be a less ugly fix than the one proposed.  Probably
> the PRINT macro and the various other evil macros in vfprintf()
> should set ret to EOF, and the following lines in vfprintf.c should
> be removed:
>
>        if (__sferror(fp))
>                ret = EOF;
>
> If vfprintf() is fixed so that printing to a buffered stream
> always returns success after a successful write (regardless of the
> prior state of the stream's error indicator), that should fix the
> problem for unbuffered streams automatically.  Unbuffered streams
> go through __sbprintf(), which throws away the output if
> vfprintf() returns -1.
>

yeah ... I wasn't overly pleased with my fix as it stands.  my concern was
that the __sferror(fp) acts as a catch-all for any non-handled error case
in the actual print logic.  there are only 2 places in the function that
explicitly set __SERR and goto error.

i'll do a thorough audit of all potential side-effects of the above calls
re: __SERR, and follow-up with something less butchered.

-- 
regards,
matt


More information about the freebsd-standards mailing list