HomeFreeBSD

printf(): Save errno earlier.

Description

printf(): Save errno earlier.

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
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D46718

(cherry picked from commit 74f1007fcc838501c74a633792c3f01833bf65e1)

Details

Provenance
desAuthored on Sep 20 2024, 4:30 PM
Reviewer
kevans
Differential Revision
D46718: printf(): Save errno earlier.
Parents
rG113e746686db: Update tzcode to 2024b.
Branches
Unknown
Tags
Unknown