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

Details

Provenance
desAuthored on Sep 20 2024, 4:30 PM
Reviewer
kevans
Differential Revision
D46718: printf(): Save errno earlier.
Parents
rG14980d69ff0f: i2c: Don't print uninitialized data when verbose
Branches
Unknown
Tags
Unknown