Page MenuHomeFreeBSD

printf(): Save errno earlier.
ClosedPublic

Authored by des on Sep 20 2024, 4:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Sep 10, 3:15 PM
Unknown Object (File)
Wed, Sep 9, 11:24 PM
Unknown Object (File)
Tue, Sep 8, 6:11 PM
Unknown Object (File)
Sun, Sep 6, 1:51 PM
Unknown Object (File)
Sat, Sep 5, 10:58 PM
Unknown Object (File)
Sat, Sep 5, 7:05 PM
Unknown Object (File)
Sat, Sep 5, 4:56 PM
Unknown Object (File)
Sat, Sep 5, 4:56 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 59541
Build 56428: arc lint + arc unit