X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=coreutils%2Ftty.c;h=4510c29963ff88cfea1a13c508f0267c36066b2c;hb=1652855fbc830f41c7ee56ece1a30b328c4fb395;hp=6f98d1b797404ce25829c19d7567a42471d85509;hpb=e5b6c7dd9cb32852a7f5b19a9855cf3c32543396;p=oweals%2Fbusybox.git diff --git a/coreutils/tty.c b/coreutils/tty.c index 6f98d1b79..4510c2996 100644 --- a/coreutils/tty.c +++ b/coreutils/tty.c @@ -20,14 +20,11 @@ * */ -#include "internal.h" #include +#include +#include #include - -static const char tty_usage[] = "tty\n\n" - "Print the file name of the terminal connected to standard input.\n\n" - "Options:\n" - "\t-s\tprint nothing, only return an exit status\n"; +#include "busybox.h" extern int tty_main(int argc, char **argv) { @@ -35,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) @@ -43,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); }