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 /sys/kern | |
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@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_clock.c | 6 | ||||
-rw-r--r-- | sys/kern/kern_sysctl.c | 4 |
2 files changed, 5 insertions, 5 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))); |