diff options
author | 2017-03-16 10:05:47 +0000 | |
---|---|---|
committer | 2017-03-16 10:05:47 +0000 | |
commit | 78fe9647bf6a20ef6f213a83c0ba2032fcb97c07 (patch) | |
tree | a50488fbc93d4b74a90dfe263593ea0fb6713c87 | |
parent | Simplify wstpad option handling: (diff) | |
download | wireguard-openbsd-78fe9647bf6a20ef6f213a83c0ba2032fcb97c07.tar.xz wireguard-openbsd-78fe9647bf6a20ef6f213a83c0ba2032fcb97c07.zip |
Fix a regression preventing ``kern.profiling'' to return the profiling
state even with a correct kernel.
Reported by jmc@, ok tb@
-rw-r--r-- | sbin/sysctl/sysctl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 41aeda92402..fd8e766cd9e 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysctl.c,v 1.224 2016/12/22 11:04:44 rzalamena Exp $ */ +/* $OpenBSD: sysctl.c,v 1.225 2017/03/16 10:05:47 mpi Exp $ */ /* $NetBSD: sysctl.c,v 1.9 1995/09/30 07:12:50 thorpej Exp $ */ /* @@ -340,8 +340,9 @@ parse(char *string, int flags) switch (mib[1]) { case KERN_PROF: mib[2] = GPROF_STATE; + mib[3] = 0; /* Assume CPU ID 0 is always valid. */ size = sizeof(state); - if (sysctl(mib, 3, &state, &size, NULL, 0) == -1) { + if (sysctl(mib, 4, &state, &size, NULL, 0) == -1) { if (flags == 0) return; if (!nflag) |