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, Jan 30, 7:42 PM
Unknown Object (File)
Sun, Jan 26, 8:38 PM
Unknown Object (File)
Fri, Jan 24, 5:38 PM
Unknown Object (File)
Dec 4 2024, 12:36 AM
Unknown Object (File)
Nov 20 2024, 4:45 PM
Unknown Object (File)
Nov 10 2024, 2:58 PM
Unknown Object (File)
Nov 4 2024, 5:26 PM
Unknown Object (File)
Nov 1 2024, 4:04 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 Not Applicable
Unit
Tests Not Applicable