From 771efb08f5bfaf22da0498ae91647fdecb3cc6bb Mon Sep 17 00:00:00 2001 From: dwmalone Date: Mon, 4 Jun 2007 18:25:08 +0000 Subject: 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. --- sys/dev/sound/pcm/feeder_rate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/dev/sound/pcm/feeder_rate.c') diff --git a/sys/dev/sound/pcm/feeder_rate.c b/sys/dev/sound/pcm/feeder_rate.c index 14cca55..79f06f1 100644 --- a/sys/dev/sound/pcm/feeder_rate.c +++ b/sys/dev/sound/pcm/feeder_rate.c @@ -130,7 +130,7 @@ sysctl_hw_snd_feeder_rate_min(SYSCTL_HANDLER_ARGS) int err, val; val = feeder_rate_min; - err = sysctl_handle_int(oidp, &val, sizeof(val), req); + err = sysctl_handle_int(oidp, &val, 0, req); if (err != 0 || req->newptr == NULL) return (err); if (RATE_FACTOR_SAFE(val) && val < feeder_rate_max) @@ -149,7 +149,7 @@ sysctl_hw_snd_feeder_rate_max(SYSCTL_HANDLER_ARGS) int err, val; val = feeder_rate_max; - err = sysctl_handle_int(oidp, &val, sizeof(val), req); + err = sysctl_handle_int(oidp, &val, 0, req); if (err != 0 || req->newptr == NULL) return (err); if (RATE_FACTOR_SAFE(val) && val > feeder_rate_min) @@ -168,7 +168,7 @@ sysctl_hw_snd_feeder_rate_round(SYSCTL_HANDLER_ARGS) int err, val; val = feeder_rate_round; - err = sysctl_handle_int(oidp, &val, sizeof(val), req); + err = sysctl_handle_int(oidp, &val, 0, req); if (err != 0 || req->newptr == NULL) return (err); if (val < FEEDRATE_ROUNDHZ_MIN || val > FEEDRATE_ROUNDHZ_MAX) -- cgit v1.1