Mercurial > hg > toybox
view toys/tty.c @ 214:98820d1eaa79
Upgrade patch to understand creating and deleting files.
author | Rob Landley <rob@landley.net> |
---|---|
date | Thu, 20 Dec 2007 06:30:19 -0600 |
parents | 25447caf1b4b |
children | d4176f3f3835 |
line wrap: on
line source
/* 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" void tty_main(void) { char *name = ttyname(0); if (!toys.optflags) { if (name) puts(name); else puts("Not a tty"); } toys.exitval = !name; }