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, Nov 16, 10:48 PM
Unknown Object (File)
Tue, Nov 11, 1:41 AM
Unknown Object (File)
Mon, Nov 10, 4:49 PM
Unknown Object (File)
Mon, Nov 10, 12:59 PM
Unknown Object (File)
Mon, Nov 10, 8:45 AM
Unknown Object (File)
Fri, Nov 7, 1:11 AM
Unknown Object (File)
Wed, Nov 5, 9:17 PM
Unknown Object (File)
Mon, Nov 3, 3:54 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