diff options
Diffstat (limited to 'toys')
-rw-r--r-- | toys/tty.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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; } |