Page MenuHomeFreeBSD

printf(): Save errno earlier.
ClosedPublic

Authored by des on Sep 20 2024, 4:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 19, 3:17 AM
Unknown Object (File)
Sat, Apr 18, 6:02 AM
Unknown Object (File)
Sat, Apr 18, 1:55 AM
Unknown Object (File)
Wed, Apr 15, 6:42 PM
Unknown Object (File)
Mar 25 2026, 8:31 AM
Unknown Object (File)
Mar 21 2026, 7:45 PM
Unknown Object (File)
Mar 14 2026, 11:42 PM
Unknown Object (File)
Mar 12 2026, 11:08 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 59541
Build 56428: arc lint + arc unit