Page MenuHomeFreeBSD

Improve error handling in acpiconf
ClosedPublic

Authored by zeising on Dec 9 2017, 12:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 10 2024, 12:35 AM
Unknown Object (File)
Jan 11 2024, 9:49 PM
Unknown Object (File)
Dec 23 2023, 3:46 AM
Unknown Object (File)
Nov 13 2023, 4:30 PM
Unknown Object (File)
Nov 13 2023, 8:00 AM
Unknown Object (File)
Nov 11 2023, 8:03 AM
Unknown Object (File)
Nov 9 2023, 11:17 PM
Unknown Object (File)
Nov 6 2023, 2:12 PM
Subscribers

Details

Summary

Error handling in acpiconf is spotty at best. In many instances we trust the result from atoi() without checking, and mutually exclusive arguments are not handled.
This patch updates acpiconf to use strol instead of atoi(), with error checking. It also takes care of arguments that are mutually exclusive, instead of trying to run all commands.

Test Plan

Compile test, as well as run through all arguments and see that they still work. Purposely use mutually exclusive arguments, and provide stuff that strol() can't interpret as a number, to see that the error handling works.

Diff Detail

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

Event Timeline

This revision is now accepted and ready to land.Dec 9 2017, 1:48 PM
This revision was automatically updated to reflect the committed changes.