Page MenuHomeFreeBSD

sndctl(8): Allow read-only sysctls
ClosedPublic

Authored by christos on May 17 2025, 9:04 PM.
Tags
None
Referenced Files
F137915877: D50398.id155838.diff
Thu, Nov 27, 5:00 AM
Unknown Object (File)
Mon, Nov 10, 3:07 AM
Unknown Object (File)
Sat, Nov 1, 10:45 PM
Unknown Object (File)
Oct 26 2025, 1:57 PM
Unknown Object (File)
Oct 18 2025, 7:08 AM
Unknown Object (File)
Oct 15 2025, 2:00 PM
Unknown Object (File)
Oct 9 2025, 11:54 AM
Unknown Object (File)
Oct 7 2025, 6:24 AM
Subscribers

Details

Summary

Needed by follow-up patch.

Sponsored by: The FreeBSD Foundation
MFC after: 1 day

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 64263
Build 61147: arc lint + arc unit

Event Timeline

usr.sbin/sndctl/sndctl.c
676

For such simple code, it's IMO better to just use an if-statement:

if (arg != NULL) {
    n = strtol(...)
    ...
}
679

For this to work correctly, you need to set errno = 0 before the strtol() call.

christos marked 2 inline comments as done.

Address Mark's comments.

This revision is now accepted and ready to land.May 18 2025, 6:24 PM
This revision was automatically updated to reflect the committed changes.