summaryrefslogtreecommitdiffstats
path: root/usr.bin/tty/tty.c
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1997-08-18 07:30:15 +0000
committercharnier <charnier@FreeBSD.org>1997-08-18 07:30:15 +0000
commitbb57ad2407023ae28885ef4f4d9f1636f6e39230 (patch)
treeee101ad90a728c5556a0a9e32febd3909217884f /usr.bin/tty/tty.c
parent467a801d978294483ea1c800047e075736a71d3f (diff)
downloadFreeBSD-src-bb57ad2407023ae28885ef4f4d9f1636f6e39230.zip
FreeBSD-src-bb57ad2407023ae28885ef4f4d9f1636f6e39230.tar.gz
Add usage().
Diffstat (limited to 'usr.bin/tty/tty.c')
-rw-r--r--usr.bin/tty/tty.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/usr.bin/tty/tty.c b/usr.bin/tty/tty.c
index 88cd60a..7a7e688 100644
--- a/usr.bin/tty/tty.c
+++ b/usr.bin/tty/tty.c
@@ -32,17 +32,25 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1988, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
+#if 0
static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/6/93";
+#endif
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
#include <stdio.h>
+#include <unistd.h>
+static void usage __P((void));
+
+int
main(argc, argv)
int argc;
char **argv;
@@ -58,8 +66,7 @@ main(argc, argv)
break;
case '?':
default:
- fputs("usage: tty [-s]\n", stderr);
- exit(2);
+ usage();
}
t = ttyname(0);
@@ -67,3 +74,10 @@ main(argc, argv)
puts(t ? t : "not a tty");
exit(t ? 0 : 1);
}
+
+static void
+usage()
+{
+ fprintf(stderr, "usage: tty [-s]\n");
+ exit(2);
+}
OpenPOWER on IntegriCloud