Page MenuHomeFreeBSD

Save errno in `warn()` family of functions
ClosedPublic

Authored by otis on Oct 19 2020, 9:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jan 9, 12:56 AM
Unknown Object (File)
Dec 5 2024, 10:09 AM
Unknown Object (File)
Nov 18 2024, 11:49 AM
Unknown Object (File)
Oct 14 2024, 4:32 PM
Unknown Object (File)
Sep 26 2024, 11:18 AM
Unknown Object (File)
Sep 26 2024, 8:55 AM
Unknown Object (File)
Sep 26 2024, 12:25 AM
Unknown Object (File)
Sep 22 2024, 12:35 PM

Details

Summary

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).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

otis requested review of this revision.Oct 19 2020, 9:17 PM

I was going to ask why you didn't do this for the err* functions too... Then realized it was probably time for me to knock off for the day if I had that question :)

This revision is now accepted and ready to land.Oct 19 2020, 11:28 PM
In D26871#599219, @imp wrote:

I was going to ask why you didn't do this for the err* functions too... Then realized it was probably time for me to knock off for the day if I had that question :)

This revision now requires review to proceed.Oct 20 2020, 7:43 AM
This revision is now accepted and ready to land.Oct 22 2020, 5:02 PM
This revision was automatically updated to reflect the committed changes.

Doh! missed the 'static' here. Removed in a followup commit.