Page MenuHomeFreeBSD

sndctl(8): Allow read-only sysctls
ClosedPublic

Authored by christos on May 17 2025, 9:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 5, 5:32 PM
Unknown Object (File)
Wed, Jun 3, 1:18 AM
Unknown Object (File)
Tue, Jun 2, 8:53 PM
Unknown Object (File)
Mon, Jun 1, 2:39 AM
Unknown Object (File)
Fri, May 22, 11:52 AM
Unknown Object (File)
May 18 2026, 3:02 PM
Unknown Object (File)
Apr 29 2026, 9:53 AM
Unknown Object (File)
Apr 29 2026, 8:53 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 Not Applicable
Unit
Tests Not Applicable

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.