It turns out that DODMALLOC was broken when I reorganized busybox.h
[oweals/busybox.git] / tty.c
diff --git a/tty.c b/tty.c
index 8ac1c1fcd1d28501c08612aeb5dbf86bae3451e3..4510c29963ff88cfea1a13c508f0267c36066b2c 100644 (file)
--- a/tty.c
+++ b/tty.c
  *
  */
 
-#include "internal.h"
 #include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
 #include <sys/types.h>
-
-static const char tty_usage[] = "tty\n\n"
-       "Print the file name of the terminal connected to standard input.\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);
 }