summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2024-02-10 15:28:17 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2024-02-10 15:28:17 +0000
commit3f7d3981d2d9d1546a12150ced0d9418f1a5592b (patch)
tree24289f4305fce779ca2cad853c2941d5cff50dce /sys
parent2d09c7f86e4584996e6be5bad1ab9ace9d9aa212 (diff)
On kernels without ucom(4) support, 'sysctl hw.ucomnames' should return
the empty string, rather than error. ok krw
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_sysctl.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 862efafbf14..91bd12930e3 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.424 2024/01/19 01:43:27 bluhm Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.425 2024/02/10 15:28:16 deraadt Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -771,14 +771,13 @@ hw_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
case HW_ALLOWPOWERDOWN:
return (sysctl_securelevel_int(oldp, oldlenp, newp, newlen,
&allowpowerdown));
-#if NUCOM > 0
case HW_UCOMNAMES: {
- const char *str = sysctl_ucominit();
- if (str == NULL)
- return EINVAL;
+ const char *str = "";
+#if NUCOM > 0
+ str = sysctl_ucominit();
+#endif /* NUCOM > 0 */
return (sysctl_rdstring(oldp, oldlenp, newp, str));
}
-#endif /* NUCOM > 0 */
#ifdef __HAVE_CPU_TOPOLOGY
case HW_SMT:
return (sysctl_hwsmt(oldp, oldlenp, newp, newlen));