summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-09-07 22:03:22 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-09-07 22:03:22 +0000
commitdaee4368eb35e6c2c98ef0e5ae9ab710b8ed330e (patch)
treef3600b7fe25b434878c4825fe7a705b7f522941e /sys/kern
parent174420bbd24b39ae1774522e7efaea7db212ef6f (diff)
Fix PR 2051, tested by miod@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_sysctl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 9b642481e68..05fb51eecf0 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.56 2001/08/18 03:32:16 art Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.57 2001/09/07 22:03:21 angelos Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -455,7 +455,11 @@ hw_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
err = sysctl_diskinit(0, p);
if (err)
return err;
- return (sysctl_rdstring(oldp, oldlenp, newp, disknames));
+ if (disknames)
+ return (sysctl_rdstring(oldp, oldlenp, newp,
+ disknames));
+ else
+ return (sysctl_rdstring(oldp, oldlenp, newp, ""));
case HW_DISKSTATS:
err = sysctl_diskinit(1, p);
if (err)