X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=tty.c;h=4510c29963ff88cfea1a13c508f0267c36066b2c;hb=30592a54514ca52253ed5f2eff64684e32d7ff05;hp=3a318ebbab5f5c1a40ac04e748a1a9b2b9ca86fa;hpb=7ab9c7ee52db8759d457819f5480378fa3aa97cc;p=oweals%2Fbusybox.git diff --git a/tty.c b/tty.c index 3a318ebba..4510c2996 100644 --- a/tty.c +++ b/tty.c @@ -20,17 +20,11 @@ * */ -#include "internal.h" #include +#include +#include #include - -static const char tty_usage[] = "tty\n" -#ifndef BB_FEATURE_TRIVIAL_HELP - "\nPrint the file name of the terminal connected to standard input.\n\n" - "Options:\n" - "\t-s\tprint nothing, only return an exit status\n" -#endif - ; +#include "busybox.h" extern int tty_main(int argc, char **argv) { @@ -38,7 +32,7 @@ extern int tty_main(int argc, char **argv) if (argc > 1) { if (argv[1][0] != '-' || argv[1][1] != 's') - usage(tty_usage); + show_usage(); } else { tty = ttyname(0); if (tty) @@ -46,5 +40,5 @@ extern int tty_main(int argc, char **argv) else puts("not a tty"); } - exit(isatty(0) ? TRUE : FALSE); + return(isatty(0) ? EXIT_SUCCESS : EXIT_FAILURE); }