diff options
author | Charlie Shepherd <masterdriverz@gentoo.org> | 2007-11-23 20:49:27 +0000 |
---|---|---|
committer | Charlie Shepherd <masterdriverz@gentoo.org> | 2007-11-23 20:49:27 +0000 |
commit | 801aa5532f36514b1a73de034591c1e7ae324a05 (patch) | |
tree | 48de6b197a00e0548a0fd184864cd5e4efa2e66e /toys/tty.c | |
parent | b938705155af45d3cc2cd6c8583e496795e79c0d (diff) | |
download | toybox-801aa5532f36514b1a73de034591c1e7ae324a05.tar.gz |
Add tty applet
Diffstat (limited to 'toys/tty.c')
-rw-r--r-- | toys/tty.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/toys/tty.c b/toys/tty.c new file mode 100644 index 00000000..c6eeac0a --- /dev/null +++ b/toys/tty.c @@ -0,0 +1,13 @@ +#include "toys.h" + +int tty_main(void) +{ + char *name = ttyname(0); + if (!toys.optflags) { + if (name) + puts(name); + else + puts("Not a tty"); + } + return !name; +} |