summaryrefslogtreecommitdiff
path: root/coreutils/tty.c
diff options
context:
space:
mode:
authorErik Andersen2000-02-08 19:58:47 +0000
committerErik Andersen2000-02-08 19:58:47 +0000
commite49d5ecbbe51718fa925b6890a735e5937cc2aa2 (patch)
treec90bda10731ad9333ce3b404f993354c9fc104b8 /coreutils/tty.c
parentc0bf817bbc5c7867fbe8fb76d5c39f8ee802692f (diff)
downloadbusybox-e49d5ecbbe51718fa925b6890a735e5937cc2aa2.zip
busybox-e49d5ecbbe51718fa925b6890a735e5937cc2aa2.tar.gz
Some formatting updates (ran the code through indent)
-Erik
Diffstat (limited to 'coreutils/tty.c')
-rw-r--r--coreutils/tty.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/coreutils/tty.c b/coreutils/tty.c
index 83abaff..8ac1c1f 100644
--- a/coreutils/tty.c
+++ b/coreutils/tty.c
@@ -1,3 +1,4 @@
+/* vi: set sw=4 ts=4: */
/*
* Mini tty implementation for busybox
*
@@ -24,19 +25,23 @@
#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";
+ "Print the file name of the terminal connected to standard input.\n"
-extern int tty_main(int argc, char **argv) {
+ "\t-s\tprint nothing, only return an exit status\n";
+
+extern int tty_main(int argc, char **argv)
+{
char *tty;
if (argc > 1) {
- if (argv[1][0] != '-' || argv[1][1] != 's') usage (tty_usage);
- }
- else {
- tty = ttyname (0);
- if (tty) puts (tty);
- else puts ("not a tty");
+ if (argv[1][0] != '-' || argv[1][1] != 's')
+ usage(tty_usage);
+ } else {
+ tty = ttyname(0);
+ if (tty)
+ puts(tty);
+ else
+ puts("not a tty");
}
- exit (isatty (0) ? TRUE : FALSE);
+ exit(isatty(0) ? TRUE : FALSE);
}