Date: Sun, 14 Apr 1996 00:45:29 -0700 (PDT) From: Lyndon Nerenberg <lyndon@orthanc.com> To: FreeBSD-gnats-submit@freebsd.org Subject: bin/1139: uname.1 and uname.c disagree about display ordering Message-ID: <199604140745.AAA01503@orodruin.orthanc.com> Resent-Message-ID: <199604140750.AAA02997@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 1139
>Category: bin
>Synopsis: uname.1 and uname.c disagree about display ordering
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Apr 14 00:50:02 PDT 1996
>Last-Modified:
>Originator: Lyndon Nerenberg
>Organization:
Orthanc Systems
>Release: FreeBSD 2.2-CURRENT i386
>Environment:
>Description:
uname(1) claims '-a' is the same as '-m -n -r -s -v' however the
code displays as '-n -r -s -v -m'.
>How-To-Repeat:
>Fix:
The following patch to /usr/src/usr.bin/uname/uname.c rearranges
the flag checks to match the man page.
===================================================================
RCS file: uname.c,v
retrieving revision 1.1
diff -c -r1.1 uname.c
*** uname.c 1996/04/14 07:35:40 1.1
--- uname.c 1996/04/14 07:36:54
***************
*** 102,107 ****
--- 102,116 ----
prefix = "";
+ if (flags & MFLAG) {
+ mib[0] = CTL_HW;
+ mib[1] = HW_MACHINE;
+ len = sizeof(buf);
+ if (sysctl(mib, 2, &buf, &len, NULL, 0) == -1)
+ err(1, "sysctl");
+ (void)printf("%s%.*s", prefix, len, buf);
+ prefix = " ";
+ }
if (flags & SFLAG) {
mib[0] = CTL_KERN;
mib[1] = KERN_OSTYPE;
***************
*** 138,152 ****
for (p = buf, tlen = len; tlen--; ++p)
if (*p == '\n' || *p == '\t')
*p = ' ';
- (void)printf("%s%.*s", prefix, len, buf);
- prefix = " ";
- }
- if (flags & MFLAG) {
- mib[0] = CTL_HW;
- mib[1] = HW_MACHINE;
- len = sizeof(buf);
- if (sysctl(mib, 2, &buf, &len, NULL, 0) == -1)
- err(1, "sysctl");
(void)printf("%s%.*s", prefix, len, buf);
prefix = " ";
}
--- 147,152 ----
>Audit-Trail:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199604140745.AAA01503>
