Page MenuHomeFreeBSD

printf(): Save errno earlier.
ClosedPublic

Authored by des on Sep 20 2024, 4:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Feb 21, 8:10 PM
Unknown Object (File)
Wed, Feb 18, 2:44 PM
Unknown Object (File)
Wed, Feb 18, 2:44 PM
Unknown Object (File)
Sun, Feb 15, 11:03 PM
Unknown Object (File)
Sun, Feb 8, 9:09 AM
Unknown Object (File)
Sun, Feb 8, 5:35 AM
Unknown Object (File)
Mon, Feb 2, 7:25 AM
Unknown Object (File)
Sat, Jan 31, 3:08 PM
Subscribers

Details

Summary

The manual page says %m is replaced with “the string representation of
the error code stored in the errno variable at the beginning of the
call”. However, we don't actually save errno until fairly late in
__vfprintf(). Make sure it is saved before we do anything that
might perturb errno.

MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable