summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2003-07-01 20:15:28 +0000
committerjmallett <jmallett@FreeBSD.org>2003-07-01 20:15:28 +0000
commita10a3eab327c64abf7e8bd5d282675a271bf1a96 (patch)
tree82973e839b3c1811f45d07b404b7dad42395f641 /usr.bin
parente95ec1f86451f8b57af444aebcc3fdc9262ca86b (diff)
downloadFreeBSD-src-a10a3eab327c64abf7e8bd5d282675a271bf1a96.zip
FreeBSD-src-a10a3eab327c64abf7e8bd5d282675a271bf1a96.tar.gz
Make the sysctlbyname stuff look like the 2-level MIB stuff. This
means actually setting 'len', for example. Which will make uname -i work on some systems where it did not. Anywhere where it did work, it was a matter of coincidence. Submitted by: redpixel on EFnet.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/uname/uname.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.bin/uname/uname.c b/usr.bin/uname/uname.c
index d4642ff..81aef45 100644
--- a/usr.bin/uname/uname.c
+++ b/usr.bin/uname/uname.c
@@ -199,6 +199,7 @@ native_##var(void) \
static char buf[1024]; \
char **varp = &(var); \
\
+ len = sizeof buf; \
if (sysctlbyname(name, &buf, &len, NULL,\
0) == -1) \
err(1, "sysctlbyname");
OpenPOWER on IntegriCloud