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/netgraph/bluetooth/common | |
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/netgraph/bluetooth/common')
-rw-r--r-- | sys/netgraph/bluetooth/common/ng_bluetooth.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netgraph/bluetooth/common/ng_bluetooth.c b/sys/netgraph/bluetooth/common/ng_bluetooth.c index 108e96b..6f6a46e 100644 --- a/sys/netgraph/bluetooth/common/ng_bluetooth.c +++ b/sys/netgraph/bluetooth/common/ng_bluetooth.c @@ -72,7 +72,7 @@ bluetooth_set_hci_command_timeout_value(SYSCTL_HANDLER_ARGS) int error; value = bluetooth_hci_command_timeout_value; - error = sysctl_handle_int(oidp, &value, sizeof(value), req); + error = sysctl_handle_int(oidp, &value, 0, req); if (error == 0 && req->newptr != NULL) { if (value > 0) bluetooth_hci_command_timeout_value = value; @@ -96,7 +96,7 @@ bluetooth_set_hci_connect_timeout_value(SYSCTL_HANDLER_ARGS) int error; value = bluetooth_hci_connect_timeout_value; - error = sysctl_handle_int(oidp, &value, sizeof(value), req); + error = sysctl_handle_int(oidp, &value, 0, req); if (error == 0 && req->newptr != NULL) { if (0 < value && value <= bluetooth_l2cap_rtx_timeout_value) bluetooth_hci_connect_timeout_value = value; @@ -131,7 +131,7 @@ bluetooth_set_l2cap_rtx_timeout_value(SYSCTL_HANDLER_ARGS) int error; value = bluetooth_l2cap_rtx_timeout_value; - error = sysctl_handle_int(oidp, &value, sizeof(value), req); + error = sysctl_handle_int(oidp, &value, 0, req); if (error == 0 && req->newptr != NULL) { if (bluetooth_hci_connect_timeout_value <= value && value <= bluetooth_l2cap_ertx_timeout_value) @@ -156,7 +156,7 @@ bluetooth_set_l2cap_ertx_timeout_value(SYSCTL_HANDLER_ARGS) int error; value = bluetooth_l2cap_ertx_timeout_value; - error = sysctl_handle_int(oidp, &value, sizeof(value), req); + error = sysctl_handle_int(oidp, &value, 0, req); if (error == 0 && req->newptr != NULL) { if (value >= bluetooth_l2cap_rtx_timeout_value) bluetooth_l2cap_ertx_timeout_value = value; |