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)
Fri, Oct 31, 12:37 AM
Unknown Object (File)
Fri, Oct 24, 9:18 PM
Unknown Object (File)
Thu, Oct 23, 7:02 AM
Unknown Object (File)
Sun, Oct 19, 8:01 AM
Unknown Object (File)
Sun, Oct 19, 2:55 AM
Unknown Object (File)
Sun, Oct 19, 2:55 AM
Unknown Object (File)
Sun, Oct 19, 2:55 AM
Unknown Object (File)
Sun, Oct 19, 12:43 AM

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.