HomeFreeBSD

warnx: Save errno across calls that might change it.

Description

warnx: Save errno across calls that might change it.

When warn() family of functions is being used after err_set_file() has
been set to, for example, /dev/null, errno is being clobbered,
rendering it unreliable after, for example, procstat_getpathname()
when it is supposed to emit a warning. Then the errno is changed to
Inappropriate ioctl for device, destroying the original value (via
calls to fprintf()functions).

Submitted by: Juraj Lutter
Differential Revision: https://reviews.freebsd.org/D26871

Details

Provenance
impAuthored on
Differential Revision
D26871: Save errno in `warn()` family of functions
Parents
rS366981: Only use ASAN when using the in-tree compiler
Branches
Unknown
Tags
Unknown