diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2007-06-04 18:25:08 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2007-06-04 18:25:08 +0000 |
commit | 771efb08f5bfaf22da0498ae91647fdecb3cc6bb (patch) | |
tree | e4320a83dea3de4df605896db823e0af0f883364 /sys/geom/cache/g_cache.c | |
parent | 360dc5b21c582598a9aaf5b3cd6f3832b847ef41 (diff) | |
download | FreeBSD-src-771efb08f5bfaf22da0498ae91647fdecb3cc6bb.zip FreeBSD-src-771efb08f5bfaf22da0498ae91647fdecb3cc6bb.tar.gz |
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.
Diffstat (limited to 'sys/geom/cache/g_cache.c')
-rw-r--r-- | sys/geom/cache/g_cache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/geom/cache/g_cache.c b/sys/geom/cache/g_cache.c index 60b0254..7be8cb3 100644 --- a/sys/geom/cache/g_cache.c +++ b/sys/geom/cache/g_cache.c @@ -66,7 +66,7 @@ sysctl_handle_pct(SYSCTL_HANDLER_ARGS) u_int val = *(u_int *)arg1; int error; - error = sysctl_handle_int(oidp, &val, sizeof(val), req); + error = sysctl_handle_int(oidp, &val, 0, req); if (error || !req->newptr) return (error); if (val < 0 || val > 100) |