Page MenuHomeFreeBSD

printf(): Save errno earlier.
ClosedPublic

Authored by des on Sep 20 2024, 4:18 PM.
Tags
None
Referenced Files
F102318659: D46718.diff
Sun, Nov 10, 2:58 PM
Unknown Object (File)
Mon, Nov 4, 5:26 PM
Unknown Object (File)
Fri, Nov 1, 4:04 AM
Unknown Object (File)
Wed, Oct 23, 1:18 PM
Unknown Object (File)
Oct 11 2024, 1:18 PM
Unknown Object (File)
Oct 3 2024, 11:31 PM
Unknown Object (File)
Oct 3 2024, 11:17 PM
Unknown Object (File)
Sep 27 2024, 7:33 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