Allow -o as a synonym for -s, for compatibility with other systems.

Using -s is preferred, but some existing scripts and makefiles expect
to get the system name from uname -o.

Reviewed by:	imp
This commit is contained in:
Ed Maste 2010-01-26 20:02:53 +00:00
parent 89d06842d8
commit 8293a8fe11
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=203042
2 changed files with 7 additions and 2 deletions

View File

@ -32,7 +32,7 @@
.\" @(#)uname.1 8.3 (Berkeley) 4/8/94 .\" @(#)uname.1 8.3 (Berkeley) 4/8/94
.\" $FreeBSD$ .\" $FreeBSD$
.\" .\"
.Dd April 2, 2003 .Dd January 26, 2010
.Dt UNAME 1 .Dt UNAME 1
.Os .Os
.Sh NAME .Sh NAME
@ -63,6 +63,10 @@ Write the kernel ident to standard output.
Write the type of the current hardware platform to standard output. Write the type of the current hardware platform to standard output.
.It Fl n .It Fl n
Write the name of the system to standard output. Write the name of the system to standard output.
.It Fl o
This is a synonym for the
.Fl s
option, for compatibility with other systems.
.It Fl p .It Fl p
Write the type of the machine processor architecture to standard output. Write the type of the machine processor architecture to standard output.
.It Fl r .It Fl r

View File

@ -88,7 +88,7 @@ main(int argc, char *argv[])
setup_get(); setup_get();
flags = 0; flags = 0;
while ((ch = getopt(argc, argv, "aimnprsv")) != -1) while ((ch = getopt(argc, argv, "aimnoprsv")) != -1)
switch(ch) { switch(ch) {
case 'a': case 'a':
flags |= (MFLAG | NFLAG | RFLAG | SFLAG | VFLAG); flags |= (MFLAG | NFLAG | RFLAG | SFLAG | VFLAG);
@ -109,6 +109,7 @@ main(int argc, char *argv[])
flags |= RFLAG; flags |= RFLAG;
break; break;
case 's': case 's':
case 'o':
flags |= SFLAG; flags |= SFLAG;
break; break;
case 'v': case 'v':