Page MenuHomeFreeBSD

printf(): Save errno earlier.
ClosedPublic

Authored by des on Sep 20 2024, 4:18 PM.
Tags
None
Referenced Files
F115139801: D46718.diff
Sun, Apr 20, 8:37 PM
Unknown Object (File)
Fri, Apr 18, 3:40 AM
Unknown Object (File)
Mar 6 2025, 3:51 AM
Unknown Object (File)
Feb 24 2025, 10:29 AM
Unknown Object (File)
Feb 22 2025, 2:18 PM
Unknown Object (File)
Feb 22 2025, 1:59 PM
Unknown Object (File)
Feb 10 2025, 9:05 AM
Unknown Object (File)
Feb 5 2025, 6:50 AM
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