aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
Diffstat (limited to 'toys')
-rw-r--r--toys/tty.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/toys/tty.c b/toys/tty.c
index c6eeac0a..d04e3012 100644
--- a/toys/tty.c
+++ b/toys/tty.c
@@ -1,13 +1,17 @@
+/* vi: set sw=4 ts=4: */
+/* tty.c - print terminal name of stdin
+ *
+ * See http://www.opengroup.org/onlinepubs/009695399/utilities/tty.html
+ */
+
#include "toys.h"
int tty_main(void)
{
char *name = ttyname(0);
if (!toys.optflags) {
- if (name)
- puts(name);
- else
- puts("Not a tty");
+ if (name) puts(name);
+ else puts("Not a tty");
}
return !name;
}