warn of the sins of wildcard MX records
[unix-history] / usr / src / usr.bin / tty / tty.c
CommitLineData
fe0057bb 1/*
bfc8e0d6
KB
2 * Copyright (c) 1988, 1993
3 * The Regents of the University of California. All rights reserved.
dd3bc3f0 4 *
cb956e54 5 * %sccs.include.redist.c%
fe0057bb
BJ
6 */
7
dd3bc3f0 8#ifndef lint
bfc8e0d6
KB
9static char copyright[] =
10"@(#) Copyright (c) 1988, 1993\n\
11 The Regents of the University of California. All rights reserved.\n";
dd3bc3f0
KB
12#endif /* not lint */
13
14#ifndef lint
bfc8e0d6 15static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) %G%";
dd3bc3f0
KB
16#endif /* not lint */
17
18#include <stdio.h>
fe0057bb
BJ
19
20main(argc, argv)
dd3bc3f0
KB
21 int argc;
22 char **argv;
fe0057bb 23{
dd3bc3f0
KB
24 int ch, sflag;
25 char *t, *ttyname();
26
27 sflag = 0;
28 while ((ch = getopt(argc, argv, "s")) != EOF)
29 switch((char)ch) {
30 case 's':
31 sflag = 1;
32 break;
33 case '?':
34 default:
35 fputs("usage: tty [-s]\n", stderr);
bd1737fa 36 exit(2);
dd3bc3f0 37 }
fe0057bb 38
dd3bc3f0
KB
39 t = ttyname(0);
40 if (!sflag)
41 puts(t ? t : "not a tty");
42 exit(t ? 0 : 1);
fe0057bb 43}