summaryrefslogtreecommitdiff
path: root/lib/libc/gen/uname.c
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1996-06-29 21:02:53 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1996-06-29 21:02:53 +0000
commit6c0cbd0961931b28647ef3e5f42668a3f66df0f4 (patch)
tree9666bebbbe7d815c979e4008a0d4dd3352ee4254 /lib/libc/gen/uname.c
parentca25e022f078e36e47224e252b65c68d25ad7897 (diff)
Make uname(1) and uname(3) do sane things for the version field; now will
show only "KERNEL#build".
Diffstat (limited to 'lib/libc/gen/uname.c')
-rw-r--r--lib/libc/gen/uname.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/libc/gen/uname.c b/lib/libc/gen/uname.c
index 80a0d6a556d..05221b60056 100644
--- a/lib/libc/gen/uname.c
+++ b/lib/libc/gen/uname.c
@@ -73,19 +73,11 @@ uname(name)
if (sysctl(mib, 2, &name->release, &len, NULL, 0) == -1)
rval = -1;
- /* The version may have newlines in it, turn them into spaces. */
mib[0] = CTL_KERN;
- mib[1] = KERN_VERSION;
+ mib[1] = KERN_OSVERSION;
len = sizeof(name->version);
if (sysctl(mib, 2, &name->version, &len, NULL, 0) == -1)
rval = -1;
- else
- for (p = name->version; len--; ++p)
- if (*p == '\n' || *p == '\t')
- if (len > 1)
- *p = ' ';
- else
- *p = '\0';
mib[0] = CTL_HW;
mib[1] = HW_MACHINE;