Some formatting updates (ran the code through indent)

-Erik
This commit is contained in:
Erik Andersen
2000-02-08 19:58:47 +00:00
parent c0bf817bbc
commit e49d5ecbbe
163 changed files with 27109 additions and 26607 deletions

View File

@@ -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);
if (argv[1][0] != '-' || argv[1][1] != 's')
usage(tty_usage);
} else {
tty = ttyname(0);
if (tty)
puts(tty);
else
puts("not a tty");
}
else {
tty = ttyname (0);
if (tty) puts (tty);
else puts ("not a tty");
}
exit (isatty (0) ? TRUE : FALSE);
exit(isatty(0) ? TRUE : FALSE);
}