summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkn <kn@openbsd.org>2020-08-20 15:12:35 +0000
committerkn <kn@openbsd.org>2020-08-20 15:12:35 +0000
commitaf27a26c2421150927f373851e6827da8bbc09ad (patch)
tree15d7339640ba6314f42ffcd8d470e554b335aa43
parent.fs -> .img (diff)
downloadwireguard-openbsd-af27a26c2421150927f373851e6827da8bbc09ad.tar.xz
wireguard-openbsd-af27a26c2421150927f373851e6827da8bbc09ad.zip
Fix build without NPCKBC and NUKBD
The "error" variable is used in one case only, so move it into scope under #ifdef. OK deraadt gnezdo
-rw-r--r--sys/arch/amd64/amd64/machdep.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 8c66181df9c..a08c375a1ee 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.268 2020/08/19 19:24:03 gnezdo Exp $ */
+/* $OpenBSD: machdep.c,v 1.269 2020/08/20 15:12:35 kn Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -486,7 +486,6 @@ cpu_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
extern int amd64_has_xcrypt;
dev_t consdev;
dev_t dev;
- int error;
switch (name[0]) {
case CPU_CONSDEV:
@@ -536,6 +535,9 @@ cpu_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
return (sysctl_rdint(oldp, oldlenp, newp, amd64_has_xcrypt));
#if NPCKBC > 0 && NUKBD > 0
case CPU_FORCEUKBD:
+ {
+ int error;
+
if (forceukbd)
return (sysctl_rdint(oldp, oldlenp, newp, forceukbd));
@@ -543,6 +545,7 @@ cpu_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
if (forceukbd)
pckbc_release_console();
return (error);
+ }
#endif
case CPU_TSCFREQ:
return (sysctl_rdquad(oldp, oldlenp, newp, tsc_frequency));