diff options
author | Erik Andersen <andersen@codepoet.org> | 2000-02-08 19:58:47 +0000 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 2000-02-08 19:58:47 +0000 |
commit | e49d5ecbbe51718fa925b6890a735e5937cc2aa2 (patch) | |
tree | c90bda10731ad9333ce3b404f993354c9fc104b8 /coreutils/tty.c | |
parent | c0bf817bbc5c7867fbe8fb76d5c39f8ee802692f (diff) | |
download | busybox-w32-e49d5ecbbe51718fa925b6890a735e5937cc2aa2.tar.gz busybox-w32-e49d5ecbbe51718fa925b6890a735e5937cc2aa2.tar.bz2 busybox-w32-e49d5ecbbe51718fa925b6890a735e5937cc2aa2.zip |
Some formatting updates (ran the code through indent)
-Erik
Diffstat (limited to 'coreutils/tty.c')
-rw-r--r-- | coreutils/tty.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/coreutils/tty.c b/coreutils/tty.c index 83abaffb5..8ac1c1fcd 100644 --- a/coreutils/tty.c +++ b/coreutils/tty.c | |||
@@ -1,3 +1,4 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | ||
1 | /* | 2 | /* |
2 | * Mini tty implementation for busybox | 3 | * Mini tty implementation for busybox |
3 | * | 4 | * |
@@ -24,19 +25,23 @@ | |||
24 | #include <sys/types.h> | 25 | #include <sys/types.h> |
25 | 26 | ||
26 | static const char tty_usage[] = "tty\n\n" | 27 | static const char tty_usage[] = "tty\n\n" |
27 | "Print the file name of the terminal connected to standard input.\n" | 28 | "Print the file name of the terminal connected to standard input.\n" |
28 | "\t-s\tprint nothing, only return an exit status\n"; | ||
29 | 29 | ||
30 | extern int tty_main(int argc, char **argv) { | 30 | "\t-s\tprint nothing, only return an exit status\n"; |
31 | |||
32 | extern int tty_main(int argc, char **argv) | ||
33 | { | ||
31 | char *tty; | 34 | char *tty; |
32 | 35 | ||
33 | if (argc > 1) { | 36 | if (argc > 1) { |
34 | if (argv[1][0] != '-' || argv[1][1] != 's') usage (tty_usage); | 37 | if (argv[1][0] != '-' || argv[1][1] != 's') |
35 | } | 38 | usage(tty_usage); |
36 | else { | 39 | } else { |
37 | tty = ttyname (0); | 40 | tty = ttyname(0); |
38 | if (tty) puts (tty); | 41 | if (tty) |
39 | else puts ("not a tty"); | 42 | puts(tty); |
43 | else | ||
44 | puts("not a tty"); | ||
40 | } | 45 | } |
41 | exit (isatty (0) ? TRUE : FALSE); | 46 | exit(isatty(0) ? TRUE : FALSE); |
42 | } | 47 | } |