summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2006-09-06 21:59:36 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2006-09-06 21:59:36 +0000
commit86a93d51e3a5d0cf0abb7e76cc9f610955ad1bf0 (patch)
tree3ed0bf311e286285d65d7588661d65bd81314e80
parentda271ed5099dceb5b89efd8fba8880cf373f2e8e (diff)
Notes
-rw-r--r--sys/kern/uipc_sockbuf.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c
index d9f1ec8cce73..f34df449e36e 100644
--- a/sys/kern/uipc_sockbuf.c
+++ b/sys/kern/uipc_sockbuf.c
@@ -253,18 +253,14 @@ static int
sysctl_handle_sb_max(SYSCTL_HANDLER_ARGS)
{
int error = 0;
- u_long old_sb_max = sb_max;
+ u_long tmp_sb_max = sb_max;
- error = SYSCTL_OUT(req, arg1, sizeof(u_long));
+ error = sysctl_handle_long(oidp, &tmp_sb_max, arg2, req);
if (error || !req->newptr)
return (error);
- error = SYSCTL_IN(req, arg1, sizeof(u_long));
- if (error)
- return (error);
- if (sb_max < MSIZE + MCLBYTES) {
- sb_max = old_sb_max;
+ if (tmp_sb_max < MSIZE + MCLBYTES)
return (EINVAL);
- }
+ sb_max = tmp_sb_max;
sb_max_adj = (u_quad_t)sb_max * MCLBYTES / (MSIZE + MCLBYTES);
return (0);
}