diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-01-21 21:02:42 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-01-21 21:02:42 +0000 |
commit | 82b15a9007b5fcf14713055793dbfbe4084e0f9d (patch) | |
tree | 3865cc43f4b4c7a9625053561a770bdbc3166355 | |
parent | 22e4957d7c02f48587b9aca5c791af9518d129fe (diff) |
Pass the new pointer to sysctl_clockrate(), so that trying to change the
value of kern.clockrate with sysctl(3) correctly sets errno on failure.
PR #6040, ok tedu@
-rw-r--r-- | sys/kern/kern_clock.c | 6 | ||||
-rw-r--r-- | sys/kern/kern_sysctl.c | 4 | ||||
-rw-r--r-- | sys/sys/sysctl.h | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 718cdb9d6e9..7e8f0dd3b9c 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_clock.c,v 1.67 2008/10/04 15:21:59 deraadt Exp $ */ +/* $OpenBSD: kern_clock.c,v 1.68 2009/01/21 21:02:39 miod Exp $ */ /* $NetBSD: kern_clock.c,v 1.34 1996/06/09 04:51:03 briggs Exp $ */ /*- @@ -577,7 +577,7 @@ statclock(struct clockframe *frame) * Return information about system clocks. */ int -sysctl_clockrate(char *where, size_t *sizep) +sysctl_clockrate(char *where, size_t *sizep, void *newp) { struct clockinfo clkinfo; @@ -589,7 +589,7 @@ sysctl_clockrate(char *where, size_t *sizep) clkinfo.hz = hz; clkinfo.profhz = profhz; clkinfo.stathz = stathz ? stathz : hz; - return (sysctl_rdstruct(where, sizep, NULL, &clkinfo, sizeof(clkinfo))); + return (sysctl_rdstruct(where, sizep, newp, &clkinfo, sizeof(clkinfo))); } #ifndef __HAVE_TIMECOUNTER diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 3a84971e4ba..c9bbbf61653 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.167 2008/10/31 17:18:24 deraadt Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.168 2009/01/21 21:02:40 miod Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -332,7 +332,7 @@ kern_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, hostid = inthostid; return (error); case KERN_CLOCKRATE: - return (sysctl_clockrate(oldp, oldlenp)); + return (sysctl_clockrate(oldp, oldlenp, newp)); case KERN_BOOTTIME: return (sysctl_rdstruct(oldp, oldlenp, newp, &boottime, sizeof(struct timeval))); diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 0092f7f739e..15570aa37ab 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sysctl.h,v 1.94 2008/10/07 02:20:11 deraadt Exp $ */ +/* $OpenBSD: sysctl.h,v 1.95 2009/01/21 21:02:41 miod Exp $ */ /* $NetBSD: sysctl.h,v 1.16 1996/04/09 20:55:36 cgd Exp $ */ /* @@ -693,7 +693,7 @@ struct walkarg; int sysctl_dumpentry(struct radix_node *, void *); int sysctl_iflist(int, struct walkarg *); int sysctl_rtable(int *, u_int, void *, size_t *, void *, size_t); -int sysctl_clockrate(char *, size_t *); +int sysctl_clockrate(char *, size_t *, void *); int sysctl_vnode(char *, size_t *, struct proc *); #ifdef GPROF int sysctl_doprof(int *, u_int, void *, size_t *, void *, size_t); |