diff options
author | David Malone <dwmalone@FreeBSD.org> | 2007-06-04 18:25:08 +0000 |
---|---|---|
committer | David Malone <dwmalone@FreeBSD.org> | 2007-06-04 18:25:08 +0000 |
commit | 041b706b2fa9a5d00d1752796abb7af549d5977b (patch) | |
tree | e4320a83dea3de4df605896db823e0af0f883364 /sys/pc98 | |
parent | df82ff50ed4d9796c4e6b2dae16c3e0e82bfa1fa (diff) | |
download | src-041b706b2fa9a5d00d1752796abb7af549d5977b.tar.gz src-041b706b2fa9a5d00d1752796abb7af549d5977b.zip |
Despite several examples in the kernel, the third argument of
sysctl_handle_int is not sizeof the int type you want to export.
The type must always be an int or an unsigned int.
Remove the instances where a sizeof(variable) is passed to stop
people accidently cut and pasting these examples.
In a few places this was sysctl_handle_int was being used on 64 bit
types, which would truncate the value to be exported. In these
cases use sysctl_handle_quad to export them and change the format
to Q so that sysctl(1) can still print them.
Notes
Notes:
svn path=/head/; revision=170289
Diffstat (limited to 'sys/pc98')
-rw-r--r-- | sys/pc98/cbus/clock.c | 2 | ||||
-rw-r--r-- | sys/pc98/cbus/pcrtc.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/pc98/cbus/clock.c b/sys/pc98/cbus/clock.c index 7b8e98294af8..874109a5c9ed 100644 --- a/sys/pc98/cbus/clock.c +++ b/sys/pc98/cbus/clock.c @@ -728,7 +728,7 @@ sysctl_machdep_i8254_freq(SYSCTL_HANDLER_ARGS) * is is too generic. Should use it everywhere. */ freq = timer_freq; - error = sysctl_handle_int(oidp, &freq, sizeof(freq), req); + error = sysctl_handle_int(oidp, &freq, 0, req); if (error == 0 && req->newptr != NULL) set_timer_freq(freq, hz); return (error); diff --git a/sys/pc98/cbus/pcrtc.c b/sys/pc98/cbus/pcrtc.c index 7b8e98294af8..874109a5c9ed 100644 --- a/sys/pc98/cbus/pcrtc.c +++ b/sys/pc98/cbus/pcrtc.c @@ -728,7 +728,7 @@ sysctl_machdep_i8254_freq(SYSCTL_HANDLER_ARGS) * is is too generic. Should use it everywhere. */ freq = timer_freq; - error = sysctl_handle_int(oidp, &freq, sizeof(freq), req); + error = sysctl_handle_int(oidp, &freq, 0, req); if (error == 0 && req->newptr != NULL) set_timer_freq(freq, hz); return (error); |