Page MenuHomeFreeBSD

printf(): Save errno earlier.
ClosedPublic

Authored by des on Sep 20 2024, 4:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 20, 12:10 PM
Unknown Object (File)
Mon, Oct 20, 12:10 PM
Unknown Object (File)
Mon, Oct 20, 12:10 PM
Unknown Object (File)
Mon, Oct 20, 12:24 AM
Unknown Object (File)
Sun, Oct 19, 9:44 PM
Unknown Object (File)
Sun, Oct 19, 4:02 AM
Unknown Object (File)
Wed, Oct 8, 10:44 AM
Unknown Object (File)
Tue, Oct 7, 1:55 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