Page MenuHomeFreeBSD

printf(): Save errno earlier.
ClosedPublic

Authored by des on Fri, Sep 20, 4:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Sep 27, 7:33 PM
Unknown Object (File)
Wed, Sep 25, 3:23 AM
Unknown Object (File)
Sat, Sep 21, 2:37 PM
Unknown Object (File)
Sat, Sep 21, 7:28 AM
Unknown Object (File)
Sat, Sep 21, 5:33 AM
Unknown Object (File)
Sat, Sep 21, 4:12 AM
Unknown Object (File)
Fri, Sep 20, 8:20 PM
Unknown Object (File)
Fri, Sep 20, 5:28 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